On Wed, Feb 24, 2010 at 1:28 PM, Ryan Garner <ryan.steven.gar...@gmail.com>wrote:
> > I have a script that creates a qplot that is then saved as a .png file > which > works fine on Windows. But I also work on Linux servers via Putty and would > like to be able to create and save my plots to my working directory. Is > there a way I can ggsave my qplot without utilizing X11 in Linux? I don't > need to view the plot in Linux, I just want the plot created and > immediately > saved to my working directory. > > I get this error: > Error in grDevices::png(..., width = width, height = height, res = dpi, : > X11 is not available > > ggsave("flie.png", my_ggplot_object) is basically equivalent to: png("file.png") print(my_ggplot_object) dev.off() but it seems that the default png device isn't working for you so perhaps you should try using another device? cairoDevice seems to support png images, i.e.: library("cairoDevice") Cairo_png("file.png") print(my_ggplot_object) dev.off() - Trevor [[alternative HTML version deleted]] ______________________________________________ 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.