[R] Prettier axis labels when using log (or exp!!) scales in Lattice (follow up)

ottorino ottorino-luca.pantani at unifi.it
Tue Jul 5 15:01:48 CEST 2011


Hi all,
my mail is a follow up of this thread
http://tolstoy.newcastle.edu.au/R/e12/help/10/11/4172.html.

I'm trying to alter the labels of an xyplot where the y variable is in
the order of millions (cell counts)

I've found plenty of examples on the R mailing list archives as well as
in the book 
Lattice: Multivariate Data Visualization with R 
at chapter 8.

Unfortunately all the examples refers to log transformation of data, but
actually what I'm looking for is exactly the reverse (exp).

An example would better show what I'm looking for.

library(latticeExtra) 
xyplot(Sepal.Length*10e3 ~ Sepal.Width, iris)

If the figures are higher, the format of the labels also changes

xyplot(Sepal.Length*10e12 ~ Sepal.Width, iris)

The y axis of the above plot is what I'm currently get with my data
I would like the y axis in the form 50^3 .
I would better say I want the y axis labels in the form 

expression(50^3).

I know from ?xyplot that the argument scales accept "log", 
and "that this is in reality a transformation of the data, not the
axes."

So the plot I would like to get is similar to

xyplot(Sepal.Length*10e3 ~ Sepal.Width, iris, 
       scales=list(y=list(log=10)),
       yscale.components = yscale.components.logpower)

but without transforming the variables  

In summary I would like to be able to use some sort of exp(10) instead
than log(10).

Any suggestion to accomplish this?
Thanks in advance

8rino



More information about the R-help mailing list