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


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

Updated on: 05-Feb-2021

4K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements