[R] log scale y axis ticks control?

About this list Date view Thread view Subject view Author view Attachment view

From: Sebastian Weber (Sebastian.Weber@physik.tu-darmstadt.de)
Date: Sun 18 May 2003 - 19:28:06 EST


Message-id: <20030518092806.GA27846@prp0.prp.physik.tu-darmstadt.de>

Hello R Users!

I'm using lattice to produce some graphs with logaritmic y-scales. I use
the command

xyplot(hits ~ c(1:1024), data=eichData, type="S", scales=list(y =
list(log=10)))

to create the plot. This is fine, except for the automatically choosen
tick marks. I'd like to have a major tick at the 10^n location and minor
ticks in between which correspond with the native variable. To get this
working I have to use at and label like

labl <- rep("", 30)
labl[1] <- "1"; labl[10] <- "10"; labl[19] <- "100"; labl[28] <- "1000";
nums <- c(1:10, seq(20,100, 10), seq(200, 1000, 100))
xyplot(hits ~ c(1:1024), data=eichData, type="S", scales=list(y =
list(log=10, at=nums, labels=labl)))

But this definitely extremly clumsy. There has to be an easier way to do
it which I haven't found yet.

Another nifty feature would be mixing these two axis styles. One axis
with linear ticks (10^0, 10^0.5, 10^1, ...) and the other axis with tick
marks as indicated above.

Thanks in advance,

Sebastian Weber

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:50 EST