How to resize labels in xyplot in R

I use xyplot in R to plot multiple lines (in groups) on the same graph:

 xyplot(y~x, type=c('l'), scales=list(tck=c(1,0)), main=list(label="Total decrease", cex=2), xlab=list(label="Years", cex=1.5), ylab=list(label="Percentage", cex=1.5), groups= group, data=df, auto.key=list(columns=2, lines=TRUE, points=FALSE, cex=1.5)) 

However, I cannot resize the label values. I tried to change the cex.axis argument (in the xlab and ylab ), but this does not change the size of the values ​​along the x or y axis.

Does anyone help?

Thanks in advance, Mark

+7
r lattice
source share
1 answer

Using the lattice functions, use scales=list(cex=1.5) to set cex for label marks along both axes.

To specify different cex values ​​for the x and y axes, follow these steps:

 library(lattice) xyplot(mpg~disp, data=mtcars, scales=list(tck=c(1,0), x=list(cex=1.2), y=list(cex=1.5))) 

enter image description here

+8
source share

All Articles