one way: x <- rnorm(100) y <- x+rnorm(100)
par(mfrow=c(2,2)) # this sets up the graphics window to expect a 2x2 layout plot(x,y) boxplot(x,y,names=c("var1","var2")) hist(x) hist(y) mtext("fourplots on same page",side=3,outer=T,line=-1.5) and you can adjust as needed to put more or less plots on the same graphics window. then save to pdf as usual. Anthony On Mon, May 17, 2010 at 12:52 PM, Jun Shen <jun.shen...@gmail.com> wrote: > 1.Open pdf device > >pdf() > 2.Do your plotting as many as you want, you won't see the plots on the > screen because they go directly to the pdf() device. > 3.Turn off the pdf() > >dev.off() > Then you can review your plots in the pdf file. For more details see ?pdf > > Jun > > On Mon, May 17, 2010 at 2:41 PM, Shirley Bao <baoxi...@gmail.com> wrote: > > I have created separate plots in multiple graphics windows using the > > windows() function in R. > > > > How do I save all the plots in one PDF file? > > > > I tried savePlot("C:/rplot.pdf", type = "pdf"). However, it only saved > the > > plot in the current graphics window. > > > > Thank you! > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help@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. > > > > ______________________________________________ > R-help@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. > [[alternative HTML version deleted]] ______________________________________________ R-help@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.