How to change the font size of main title of boxplot in base R?

R ProgrammingServer Side ProgrammingProgramming

The font size of the main title of boxplot can be changed by defining the font size value using par(cex.main=”size”), here size value can be changed based on our requirement. This needs to be done before creating the boxplot, otherwise, there will be no effect on the size of the main title.

Example

 Live Demo

x<−rnorm(50)
par(cex.main=0.5)
boxplot(x,main="boxplot")

Output

Creating the plot with different font size of main title −

Example

par(cex.main=2.5)
boxplot(x,main="boxplot")

Output

raja
Published on 05-Feb-2021 08:33:32
Advertisements