[R] Print several xyplots to the same page in a pdf file

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Oct 30 07:53:17 CET 2009


2009/10/27 Joel Fürstenberg-Hägg <joel_furstenberg_hagg at hotmail.com>:
>
> Hello everybody,
>
> I'm using the lattice package and the xyplot to make several graphs like below. However, I can just print the three grouped plots onto one page as I'm putting them into a pdf-file, which gives me a huge amount of pages... Is it possible to put them all, or at least more than one on the same page, for instance put three groups beside each other like columns?
>
> ...
> xyplot(Pro ~ Glc | Categories_BBCH_ID, data=fieldTrial0809, pch="°", layout=c(1, 3), aspect=1, index.cond=list(3:1))
> xyplot(Pro ~ Raf | Categories_BBCH_ID, data=fieldTrial0809, pch="°", layout=c(1, 3), aspect=1, index.cond=list(3:1))
> xyplot(Pro ~ Suc | Categories_BBCH_ID, data=fieldTrial0809, pch="°", layout=c(1, 3), aspect=1, index.cond=list(3:1))
> xyplot(Fum ~ Aa | Categories_BBCH_ID, data=fieldTrial0809, pch="°", layout=c(1, 3), aspect=1, index.cond=list(3:1))
> xyplot(Fum ~ Pro | Categories_BBCH_ID, data=fieldTrial0809, pch="°", layout=c(1, 3), aspect=1, index.cond=list(3:1))
> etc...

I'm not entirely sure what you want, but what about some variant of

xyplot(Pro ~ Glc + Raf + Suc | Categories_BBCH_ID,
data=fieldTrial0809, outer = TRUE,
       pch="°", layout=c(3, 3), aspect=1, as.table = TRUE)

-Deepayan




More information about the R-help mailing list