[R] Display Multiple page lattice plots

Gabor Grothendieck ggrothendieck at gmail.com
Thu Jun 7 12:41:32 CEST 2007


This works on my Windows machine starting off at a new R session:

options(graphics.record = TRUE)
library(lattice)
xyplot(uptake ~ conc | Plant, CO2, layout = c(2,2))

Now switch focus to the graphics window and you can PgUp and PgDn
through them.

There are several variations to this:

1. use graphics.record option as shown above
2. the graphics.record option is passed to the windows driver so explicitly
call windows yourself.  See ?windows
3. prior to your xyplot switch focus to the graphics window and a History
menu appears.  Use that to turn on recording.


On 6/7/07, rhelp.20.trevva at spamgourmet.com
<rhelp.20.trevva at spamgourmet.com> wrote:
> Gudday,
>
> I am generating a series of lattice contourplots that are conditioned on a variable (Year) that has 27 different levels. If I try and put them all on one plot, it ends up pretty messy and you can't really read anything, so instead I have set the layout to 3x3, thus generating three pages of nine plots each. The problem is that I can't display all these on screen at once, because each subsequent page overwrites the previous one. I have found in the mailing lists how to print them to separate files without any problems eg.
>
>      p<-contourplot(log10(x)~lat*long|Year,
>                  data=data.tbl,
>                  layout=c(3,3))
>      png(file="Herring Distribution%02d.png",width=800,height=800)
>      print(p)
>      dev.off()
>
> but there doesn't seem to be anything about how to output multiple pages to the screen... I suspect that I may need to use the page=... option in contourplot command, but I can't seem to make it work. Its a simple, and not particularly important problem, but it sure is bugging me!
>
> Thanks for the advice in advance.
>
> Cheers,
>
> Mark
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list