[R] Prettier axis labels when using log scales in Lattice

Marc Paterno paterno at fnal.gov
Sat Nov 6 20:02:57 CET 2010


Hello,

I am trying to alter the way in which lattice functions (specifically xyplot) print the axis labels when one uses the 'scales' parameter.
I can obtain the effect I want by using
  scales=list(y=list(log=10, labels=expression(yvalues)))
where yvalues are the values that would have been printed as the y-axis labels if the "labels" argument had not been present. To help clarify what I am looking for, compare the first of the following plots with the second:

data(iris)
xyplot(Sepal.Length~Sepal.Width, iris, scales=list(y=list(log=10)))

xyplot(Sepal.Length~Sepal.Width, iris, scales=list(y=list(log=10, labels=expression(10^0.65,10^0.7,10^0.75,10^0.8,10^0.85,10^0.85,10^0.9))))

The second is the effect I am trying to achieve. Is there a way to do this without explicitly entering the expressions to be printed on the y-axis?

thanks,
Marc Paterno



More information about the R-help mailing list