[R] plotting a 1000 plots?

Roger Peng rpeng at stat.ucla.edu
Wed May 22 23:30:03 CEST 2002


I believe you can send multiple plots to a pdf file by leaving the pdf()
device open.  By default, each new plot will be put on a different page in
the pdf file.  So,

pdf(file="lotsofplots.pdf")
par(mfcol=c(2,2))
plot(x1,y1)
plot(x2,y2)
plot(x3,y3)
dev.off()

The file 'lotsofplots.pdf' should have three pages. However, I remember
reading on this list somewhere that there's a hard limit of 512 pages to a
file, but I'm not 100% sure.  You may have to use one or two files,
depending on the number of datasets you're plotting. But I suppose that's
better than 1000 files.

-roger
_______________________________
UCLA Department of Statistics
rpeng at stat.ucla.edu
http://www.stat.ucla.edu/~rpeng

On Wed, 22 May 2002, Jeff D. Hamann wrote:

> I would like to plot lots of plots (2x2 plots) of a set of data for many
> sets. I can do it just fine for one set of data, but I would like to
> generate a small mountain of plots for others to examine. Basically, I would
> like to generate the same par( mcol=c(2,2) ) plot for about 1000 datasets.
> I've been iterating through them in the plot window, but I would like to
> send all the plots to a eps file and plot the eps file (or bring the thing
> into a latex doc and generate the pdf which I can do no problem. I don't
> knwo who many datasets I will have and may and I think I'll just have to
> create one file for each plot into a dir and somehow bring all the plots in
> the dir into a document. Has anyone any suggestions for this task?
> 
> 
> Thanks,
> Jeff.
> 
> 
> Jeff D. Hamann
> Hamann, Donald & Associates
> PO Box 1421
> Corvallis, Oregon 97339
> jeff_hamann at hamanndonald.com
> www.hamanndonald.com
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list