Mikhail Titov
2011-Aug-15 17:04 UTC
[R] lattice: How to get log base for each axis inside panel function?
Hello! I'd like to have a function to draw correct grid while using log axis with xyplot from lattice package. Right now I have the following code inside of my panel function: lim <- current.panel.limits() v <- latticeExtra:::logTicks(2^lim$xlim, loc=1) h <- latticeExtra:::logTicks(2^lim$ylim, loc=1) panel.abline(h=log2(h), v=log2(v), col="LightGray") Is there an easy way to get log base used for particular axis to transform data so I can write general purpose panel.grid.log? Mikhail
Deepayan Sarkar
2011-Aug-16 05:01 UTC
[R] lattice: How to get log base for each axis inside panel function?
On Mon, Aug 15, 2011 at 10:34 PM, Mikhail Titov <mlt at gmx.us> wrote:> Hello! > > I'd like to have a function to draw correct grid while using log axis with xyplot from lattice package. Right now I have the following code inside of my panel function: > > lim <- current.panel.limits() > v <- latticeExtra:::logTicks(2^lim$xlim, loc=1) > h <- latticeExtra:::logTicks(2^lim$ylim, loc=1) > panel.abline(h=log2(h), v=log2(v), col="LightGray") > > Is there an easy way to get log base used for particular axis to transform data so I can write general purpose panel.grid.log?No. The panel function gets no information regarding transformations done to the data before being passed to it. -Deepayan
Apparently Analagous Threads
- lattice logaritmic scale (basis "e" ), rewriting labels using xscale.component
- xyplot: distance between axis and axis-label gets wrong
- Several quick questions
- como agrego una linea dibujada con abline() en la leyenda de un grafico ?
- Can't Get Lattice Histogram Minor Tick Marks to Work