Hello. I am using R with Mac X11. I am looping through a few hundreds of text lines, making a plot() for each of them. I would like to save these plots graphical images into separate graphical files and I didn't succeed doing that. I would be grateful for any suggestion. -- View this message in context: http://www.nabble.com/Saving-plot-into-file-tf4359947.html#a12425669 Sent from the R help mailing list archive at Nabble.com.
uv wrote:> > Hello. I am using R with Mac X11. I am looping through a few hundreds of > text lines, making a plot() for each of them. I would like to save these > plots graphical images into separate graphical files and I didn't succeed > doing that. I would be grateful for any suggestion. >Use jpeg or similar functions that redirect graphical output to file, e.g. jpeg(filename = "plot.jpg", width = 800, height = 800,pointsize = 12, quality = 100, bg = "white") plot(...) dev.off() As mentioned in ?jpeg : "A plot device is opened: nothing is returned to the R interpreter" so you'll see nothing happening except your next graphics command will be written to the file. dev.off() restores the normal R-graphics device. I usually set the working directory before redirecting the ouput to a file e.g. setwd("C:/dir/subdir"). That's useful when you have many plots to generate and want them stored in different places on your filesystem. HTH, yvesm -- View this message in context: http://www.nabble.com/Saving-plot-into-file-tf4359947.html#a12426520 Sent from the R help mailing list archive at Nabble.com.
?Devices e.g. ?pdf Bert Gunter Genentech Nonclinical Statistics -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of uv Sent: Friday, August 31, 2007 5:41 AM To: r-help at stat.math.ethz.ch Subject: [R] Saving plot into file Hello. I am using R with Mac X11. I am looping through a few hundreds of text lines, making a plot() for each of them. I would like to save these plots graphical images into separate graphical files and I didn't succeed doing that. I would be grateful for any suggestion. -- View this message in context: http://www.nabble.com/Saving-plot-into-file-tf4359947.html#a12425669 Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help at stat.math.ethz.ch 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.