Re: [R] Problems exporting graphs

From: Daniel Folkinshteyn <dfolkins_at_gmail.com>
Date: Thu, 26 Jun 2008 20:59:33 -0400

not sure why it doesn't work, but try the following: first, plot to a regular window, then run:  > dev.copy(device=png, file="yourfilename.png")  > dev.off()

see if that produces a file you want.

another note: what do you mean you can't just "copy and paste the graph" in ubuntu? doesn't pressing print-screen make a screenshot? doesn't pressing alt-printscreen make a screenshot of the current active window? (or even from the main menu, "applications-> accessories -> take screenshot" should work).

on 06/26/2008 08:43 PM Sam Albers said the following:
> I have trying to figure this out all day so hopefully the answer isn't too
> obvious. I am able to view a graph in the viewer window. However, I need to
> export graph outside of the viewer window. Here is the script I am using:
>
>> png("Compare.png")
>> plot(compare$DepthSLI, compare$DischargeSLI, col="blue", xlab = "Average
> Water Depth (cm)", ylab = "Discharge (m^3/s)", xlim=c(5,40),
> ylim=c(0.03,0.1), main="Discharge in Flume 1")
>> dev.off()
> null device
> 1
>
> When I do this R simply produces an empty file that produces an error
> message when I try to open it. I have tried this same script with every file
> format available under help(device) all with the same result. I am running
> Ubuntu 8.04 so I unable to simply copy and paste the graph as in windows. I
> am fairly sure I have all the right packages installed. I am running R
> 2.6.2-2. Any suggestions?
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>



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 Fri 27 Jun 2008 - 01:03:10 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 Fri 27 Jun 2008 - 16:30:44 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