[R-SIG-Mac] Saving or copying graphics from Quartz returns empty file

Duncan Murdoch murdoch.duncan at gmail.com
Tue Jan 29 12:45:07 CET 2013


On 13-01-25 10:59 AM, Heather CHAPMAN wrote:
> Hi,
>
> Can anyone suggest some help for saving or copying graphs I've created
> in the Quartz screen? I've read the R-FAQ and tried to search for
> answers, but have not found anything. I'm using a Mac, Mountain Lion OS,
> and have version 2.15.2 of R.

I don't know the cause of the problem you're seeing, but I generally 
recommend to people that they generate graphs in the final format, 
rather than saving them from some other format.

In your case, that would mean working out the code to make your plot 
look good on screen, then redo it all directly to the pdf device, by 
simply wrapping the code in

pdf(file="foo.pdf")
  ... your code to draw the plot ...
dev.off()

This is preferable because the graphics system makes some choices 
(spacing, etc.) based on the characteristics of the output device; if 
you copy from a screen device to a print device, those
choices may be different.

Duncan Murdoch
>
>
> When I save a graphic, the process either crashes R, or if it saves a
> file, when I open it I get a blank file or an error message that reads
> "The file Rplot.pdf could not be opened." When I try to copy the graphic
> instead to paste into any other program (Word, Excel, etc), a blank
> image frame is all I get. I have also tried running graphics and either
> saving or exporting from RStudio and have the same issues.
>
>
> I assume there is some package I've not loaded or some bug fix I need to
> get, but I can't find any documentation about it. Any ideas?
>
>
> Thanks,
>
> Heather Chapman
>
>
> Heather Chapman
> Senior Research Analyst for Assessment
> Office of Institutional Effectiveness
> 4002 University Circle
> Ogden, Utah 84408
> Phone: (801) 626-7177
>
>
>
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>



More information about the R-SIG-Mac mailing list