Re: [R] Multi-plot figures with different numbers of plots indifferentrows

From: Earl F. Glynn <efg_at_stowers-institute.org>
Date: Wed 30 Mar 2005 - 08:59:58 EST

"Paul Murrell" <p.murrell@auckland.ac.nz> wrote in message news:<4249D8B7.9070702@stat.auckland.ac.nz>...
> Does this do what you want?
>
> layout(rbind(c(1, 2, 3),
> c(0, 4, 0)))
> plot(1:10, main="Plot 1")
> plot(1:20, main="Plot 2")
> plot(1:30, main="Plot 3")
> plot(1:40, main="Plot 4")
> # new page!
> plot(1:40, main="Plot 5")

Yes, that works nicely. Thank you very much.

I tried this wrapped with a pdf/dev.off and it works great:

pdf("test.pdf")
  <plot statements here>
dev.off()

I guess I should always use layout and avoid using mfrow or mfcol, since it's more flexible in general.

I can't decide if the existing behavio(u)r of mfrow/mfcol is a "bug" or a "feature" when some plots are to be left blank, and one wants to advance to the next figure. With your solution, I won't need to care <g>. Thanks.

efg



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 Wed Mar 30 09:09:45 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:57 EST