Joel Fürstenberg-Hägg
2009-Oct-27 18:54 UTC
[R] Print several xyplots to the same page in a pdf file
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... All the best, Joel _________________________________________________________________ Nya Windows 7 - Hitta en dator som passar dig! Mer information. http://windows.microsoft.com/shop [[alternative HTML version deleted]]
Dieter Menne
2009-Oct-27 19:05 UTC
[R] Print several xyplots to the same page in a pdf file
Joel F?rstenberg-H?gg wrote:> > > 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 amountCheck the documentation and examples for print.trellis; I prefer the "split" version, but other are possible. And do not forget that it is best to do an explicit print. p1 = xyplot(....) p2 = xyplot() print(p1,split=c(1,1,2,1)) print(p2,split=c(2,1,2,1)) Dieter -- View this message in context: http://www.nabble.com/Print-several-xyplots-to-the-same-page-in-a-pdf-file-tp26083087p26083254.html Sent from the R help mailing list archive at Nabble.com.
Deepayan Sarkar
2009-Oct-30 06:53 UTC
[R] Print several xyplots to the same page in a pdf file
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