[R] Can not save plot to png file correctly

From: Felipe Carrillo <mazatlanmexico_at_yahoo.com>
Date: Mon, 31 May 2010 12:59:56 -0700 (PDT)


With ggsave the graph windows pops up but using: png("mypng.png")
qplot(X, data=data, geom='histogram') + facet_wrap( ~ Y) dev.off()
The graph is saved in the background
Is there a way to hide the graph window when using ggsave?

You can save as png like this too:

library(ggplot2)
data=data.frame(
  X=sample(10,1000,replace=T)
  , Y=letters[1:10])
png("mypng.png")
qplot(X, data=data, geom='histogram') + facet_wrap( ~ Y) dev.off()

 

Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA



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. Received on Mon 31 May 2010 - 20:02:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 31 May 2010 - 21:30:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive