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
----- Original Message ---- > From: Peng Yu <pengyu...@gmail.com> > To: ggplot2 <ggpl...@googlegroups.com> > Sent: Mon, May 31, 2010 12:20:12 PM > Subject: Can not save plot to png file correctly > > library(ggplot2) data=data.frame( > X=sample(10,1000,replace=T) , Y=letters[1:10] > ) p=qplot(X, data=data, geom='histogram') + facet_wrap( ~ Y) save(p, > file='error.png') The above qplot work properly if I don't plot it to a > file. But if I plot it to a png file, the png file is always corrupted. Would > you please let me know what is wrong? -- > Regards, Peng -- You received this message because you are > subscribed to the ggplot2 mailing list. Please provide a reproducible > example: http://gist.github.com/270442 To post: email > ymailto="mailto:ggpl...@googlegroups.com" > href="mailto:ggpl...@googlegroups.com">ggpl...@googlegroups.com To > unsubscribe: email ggplot2+> > href="mailto:unsubscr...@googlegroups.com">unsubscr...@googlegroups.com More > options: http://groups.google.com/group/ggplot2 ______________________________________________ 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.