Or you can plot first, when you are satisfied with it, copy the plot to another device. for example,
>X11() >plot(rnorm(10)) >dev.copy(png) ## copy the plot to an png file. Best 2009/8/11 Rodrigo Aluizio <r.alui...@gmail.com>: > You can save plots as specified below. For details see ?png, ?postscrip, > ?tiff, ?jpeg, ?bmp. > > postscript(file = ifelse(onefile, "Rplots.ps", "Rplot%03d.ps"), > onefile, family, title, fonts, encoding, bg, fg, > width, height, horizontal, pointsize, > paper, pagecentre, print.it, command, > colormodel, useKerning) > bmp(filename = "Rplot%03d.bmp", width = 480, height = 480, > units = "px", pointsize = 12, bg = "white", res = NA, > restoreConsole = TRUE) > jpeg(filename = "Rplot%03d.jpg", width = 480, height = 480, > units = "px", pointsize = 12, quality = 75, bg = "white", > res = NA, restoreConsole = TRUE) > png(filename = "Rplot%03d.png", width = 480, height = 480, > units = "px", pointsize = 12, bg = "white", res = NA, > restoreConsole = TRUE) > tiff(filename = "Rplot%03d.tif", width = 480, height = 480, > units = "px", pointsize = 12, > compression = c("none", "rle", "lzw", "jpeg", "zip"), > bg = "white", res = NA, > restoreConsole = TRUE) > > > -----Mensagem original----- > De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em > nome de Sean MacEachern > Enviada em: segunda-feira, 10 de agosto de 2009 13:26 > Para: r-help@r-project.org > Assunto: [R] Saving plots to file > > Appologies if this has been addressed before, but I can't seem to find it in > the help archives. > > I'm looking to do something like the following but it looks like save.plot > is deprecated. > > save.plot(plot(glm1$residuals,gain,main = "Hist of residuals and > gain"),file="Desktop/hist1.png") > > > Thanks in advance, > > Sean > > Session Info: > > R version 2.9.1 (2009-06-26) > i386-apple-darwin8.11.1 > > locale: > en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > loaded via a namespace (and not attached): > [1] tools_2.9.1 > > ______________________________________________ > 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. > -- HUANG Ronggui, Wincent PhD Candidate Dept of Public and Social Administration City University of Hong Kong Home page: http://asrr.r-forge.r-project.org/rghuang.html ______________________________________________ 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.