Re: [R] Splitting device for ggplots?

2008-11-03 Thread Jim Price
You could write a function to get rid of a lot of the grunt work; for example (this using lattice instead of ggplot, but should be pretty much the same): library(lattice) library(grid) graphics.off() myPlot1 <- xyplot(1 ~ 1 | 1) myPlot2 <- xyplot(2 ~ 2 | 2) myPlot3 <- xyplot(3 ~ 3 | 3) myPlot

Re: [R] Splitting device for ggplots?

2008-11-03 Thread Vitalie Spinu
Thanks Baptiste and Hadley, That viewports mechanism is indeed extremely versatile when it comes to publication or designing new plot functions. But for interactive analysis all these "pushing" and "popping" is just a way too much code - for each plot at least two additional grid functions,

Re: [R] Splitting device for ggplots?

2008-11-01 Thread hadley wickham
On Sat, Nov 1, 2008 at 5:13 AM, baptiste auguie <[EMAIL PROTECTED]> wrote: > Hi, > > I believe you can apply the same procedure as described in Paul Murrell's "R > graphics" book for arranging lattice plots. Yup, and see also http://had.co.nz/ggplot2/book/grid.pdf Hadley -- http://had.co.nz/

Re: [R] Splitting device for ggplots?

2008-11-01 Thread baptiste auguie
Hi, I believe you can apply the same procedure as described in Paul Murrell's "R graphics" book for arranging lattice plots. library(grid) library(ggplot2) ?grid.layout df <- data.frame(x=rnorm(100), y=rnorm(100)) df2 <- data.frame(x <- rnorm(100), y=runif(x)) p <- qplot(x,y, data=df) p2 <

[R] Splitting device for ggplots?

2008-11-01 Thread Vitalie Spinu
Dear UseRs, For various reasons I need to plot multiple ggplots on one device (preferably pdf). Is there a way to achieve that? par(mfrow), split.screen() and layout() seem not to do the job. Thanks, Vitalie. __ R-help@r-project.org mailing list ht