문제

I'm using xyplot in R to plot several lines (by group) on one 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 am unable to change the size of the label values. I have tried changing the argument cex.axis (within the xlab and ylab options), but this does not change the size of values along either the x- or the y-axes.

Can anybody help?

Thanks in advance, Mark

도움이 되었습니까?

해결책

With lattice plotting functions, use scales=list(cex=1.5) to set cex for tick labels along both axes.

To specify different cex values for x- and y- axes, do something like this:

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top