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

From: Deepayan Sarkar <deepayan.sarkar_at_gmail.com>
Date: Fri 29 Jul 2005 - 04:14:11 EST

On 7/27/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
> ---------------------------------
> Colleagues
>
> I have a set of lattice plots, and want to plot 4 of them on the page.
> I am having trouble with the layout.
>
> grid.newpage()
> pushViewport(viewport(layout = grid.layout(2,2)))
> pushviewport(viewport(layout.pos.col = 1, layout.pos.row = 1))
> working trellis graph code here
> pushviewport(viewport(layout.pos.col = 1, layout.pos.row = 2))
> working trellis graph code here
> pushviewport(viewport(layout.pos.col = 2, layout.pos.row = 1))
> working trellis graph code here
> pushviewport(viewport(layout.pos.col = 2, layout.pos.row = 2))
>
> I'm obviously doing something wrong since my graphs still print one 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

> Would you be able to provide advice?
>
> Thanks
>
> Sam
> ----
> Sam McClatchie,
> Biological oceanography
> South Australian Aquatic Sciences Centre
> PO Box 120, Henley Beach 5022
> Adelaide, South Australia
> email <mcclatchie.sam@saugov.sa.gov.au>
> Telephone: (61-8) 8207 5448
> FAX: (61-8) 8207 5481
> Research home page <http://www.members.iinet.net.au/~s.mcclatchie/>
>
> /\
> ...>><xX(>
> //// \\\\
> <)Xx><<
> ///// \\\\\\
> ><(((>
> >><(((> ...>><xX(>O<)Xx><<
>
> ______________________________________________
> 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
>



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 Fri Jul 29 04:19:23 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:34:07 EST