Re: [R] lattice/ grid.layout/ multiple graphs per page

From: Deepayan Sarkar <deepayan.sarkar_at_gmail.com>
Date: Mon 01 Aug 2005 - 11:11:20 EST

On 7/28/05, McClatchie, Sam (PIRSA-SARDI) <mcclatchie.sam@saugov.sa.gov.au> wrote:
> Background:
> OS: Linux Mandrake 10.1
> release: R 2.0.0
> editor: GNU Emacs 21.3.2
> front-end: ESS 5.2.3
> ---------------------------------
>
> >-----Original Message-----
> >From: Deepayan Sarkar [mailto:deepayan.sarkar@gmail.com]
> >Sent: Friday, 29 July 2005 3:44 AM
> >To: McClatchie, Sam (PIRSA-SARDI)
> >Cc: R-Help-Request (E-mail)
> >Subject: Re: [R] lattice/ grid.layout/ multiple graphs per page
>
> >Depends on the details of your 'working trellis code'. Are you using
> >print() explicitly with 'newpage=FALSE'? See ?print.trellis for
> >details.
> >
> >Deepayan
>
> -------------------------
> Sorry Deepayan, I should have included the full code originally.
> Here it is, with your suggestion for using the newpage=FALSE option to
> print(). I still have not got it right.

Your code is not reproducible (but full of irrelevant details). All the grid layout stuff is commented out, so I am not sure what you expect this code to do.

Anyway, you are probably missing some upViewport / popViewport calls, since the following does what I would expect:

library(lattice)
library(grid)

p <- xyplot(1 ~ 1)

grid.newpage()
pushViewport(viewport(layout = grid.layout(2, 2)))

pushViewport(viewport(layout.pos.col=1, layout.pos.row=1)) print(p, newpage = FALSE)
popViewport(1)

pushViewport(viewport(layout.pos.col=2, layout.pos.row=2)) print(p, newpage = FALSE)
popViewport()



R-help@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 Received on Mon Aug 01 11:16:07 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:00:26 EST