On Fri, 2010-07-16 at 11:17 -0400, linda.s wrote: > I made a plot, but after I made a second plot, the previous plot was > gone. How can I save all the plots in a file (I do not manually copy > and paste them one by one)? > Thanks. > Linda
[I presume you addressed this to Duncan Murdoch for a good reason???] Open a new device before plotting, do your plotting, close the device. For example, using a PDF device via pdf(): pdf("my_plots.pdf", height = 8, width = 8, pointsize = 10, version = "1.4", onefile = TRUE) for(i in 1:10) { y <- rnorm(100) x <- rnorm(100) plot(y ~ x) } dev.off() The last line (dev.off() is very important as the file will not be valid pdf without closing the device. HTH G -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Dr. Gavin Simpson [t] +44 (0)20 7679 0522 ECRC, UCL Geography, [f] +44 (0)20 7679 0565 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/ UK. WC1E 6BT. [w] http://www.freshwaters.org.uk %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% ______________________________________________ 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.