[R] boxplot axis font size

Rolf Turner r.turner at auckland.ac.nz
Mon May 26 00:28:53 CEST 2014


On 25/05/14 23:57, Brian Smith wrote:
> Hi,
>
> I wanted to have a different font for my x-axis and y-axis. How can I use
> the par function to specify different font sizes for x and y axis? For
> example:
>
> x <- matrix(rnorm(2000),200,10)
> colnames(x) <- letters[1:10]
> par(cex.axis=0.5)
> boxplot(x,cex=0.2)
>
> But this sets the font size to 0.5 for both the x and y axis? How can I
> make the y-axis to 1.5?

How about:

 > boxplot(x,cex=0.2,axes=FALSE)
 > axis(1,cex.axis=0.5)
 > axis(2,cex.axis=1.5)

Does that get you what you want?

cheers,

Rolf Turner



More information about the R-help mailing list