Mark Heckmann
2009-Jan-07 10:01 UTC
[R] can the pdf output page break be controlled manually?
I would like to control where to make a page break in my pdf file. The following code renders three pages of output. But I would like to be able to control the page breaks. pdf(file="test.pdf", paper="a4") par(mfrow=c(2,2)) hist(rnorm(100)) hist(rnorm(100)) hist(rnorm(100)) plot.new() par(mfrow=c(1,1)) hist(rnorm(100)) hist(rnorm(100)) dev.off() It would be much more convenient though, to enter a page break command within the code instead of plot.new(). Is there a way to do this? TIA, Mark
jim holtman
2009-Jan-07 13:58 UTC
[R] can the pdf output page break be controlled manually?
Try just leaving off the 'plot.new()'; When you change mfrow it creates a new page. On Wed, Jan 7, 2009 at 5:01 AM, Mark Heckmann <mark.heckmann at gmx.de> wrote:> I would like to control where to make a page break in my pdf file. > The following code renders three pages of output. But I would like to be > able to control the page breaks. > > pdf(file="test.pdf", paper="a4") > par(mfrow=c(2,2)) > hist(rnorm(100)) > hist(rnorm(100)) > hist(rnorm(100)) > plot.new() > > par(mfrow=c(1,1)) > hist(rnorm(100)) > hist(rnorm(100)) > dev.off() > > It would be much more convenient though, to enter a page break command > within the code instead of plot.new(). > > Is there a way to do this? > > TIA, Mark > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve?
Duncan Murdoch
2009-Jan-07 14:03 UTC
[R] can the pdf output page break be controlled manually?
On 1/7/2009 5:01 AM, Mark Heckmann wrote:> I would like to control where to make a page break in my pdf file. > The following code renders three pages of output. But I would like to be > able to control the page breaks. > > pdf(file="test.pdf", paper="a4") > par(mfrow=c(2,2)) > hist(rnorm(100)) > hist(rnorm(100)) > hist(rnorm(100)) > plot.new() > > par(mfrow=c(1,1)) > hist(rnorm(100)) > hist(rnorm(100)) > dev.off() > > It would be much more convenient though, to enter a page break command > within the code instead of plot.new().The par(mfrow=c(1,1)) command will cause a page break, so just do nothing. I don't know if that's "much more convenient" than entering plot.new(), but it's a little better. Duncan Murdoch> > Is there a way to do this? > > TIA, Mark > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.