[R] Saving plots to file

Sean MacEachern sean.maceach at gmail.com
Mon Aug 10 18:58:22 CEST 2009


Thank you Cedric.

That was a nice straight forward example that works great.

Cheers,

Sean


On 8/10/09 11:45 AM, "Cedrick Johnson" <cedrick at cedrickjohnson.com> wrote:

> Try this:
> 
> png(file="Desktop/hist1.png")
> plot(glm1$residuals,gain,main =  "Hist of residuals and gain")
> dev.off()
> 
> -c
> 
> Sean MacEachern wrote:
>> 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 at 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.
>>   
>




More information about the R-help mailing list