[R] Two different yaxes with lattice plots

Deepayan Sarkar deepayan at stat.wisc.edu
Thu Dec 5 06:00:05 CET 2002


On Wednesday 04 December 2002 10:13 pm, Patrick Connolly wrote:

> In "normal" plots, I can do an axis at side = 2 and a different one at
> side = 4.  I've not been able to figure out how to do the same thing
> with lattice plots.  The scales list can have only one sublist named
> y.  I had thought of using a separate viewport alongside with the text
> for the axis label, but I can't see how I could get the ticks to work.

You probably won't be able to do this in lattice (and I can't think of a 
sensible way to modify lattice to allow this that would work for multipanel 
plots). Why do you need lattice for this ? If this is a single-panel plot, 
you could use grid directly. Set the viewport to whatever you want, draw in 
it (you could use a lattice panel function to do that if you want), and add 
the axes with grid.xaxis and grid.yaxis. 

Deepayan




More information about the R-help mailing list