[R-SIG-Mac] quartz.save()

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Apr 15 08:01:57 CEST 2008


On Tue, 15 Apr 2008, Todd A. Johnson wrote:

> Hi Dr. Ripley:

Please try reading my signature block.

> The previous quartz help did not list "pdf" in the output formats, but
> nevertheless seemed to save "pdf" files, although with the recently
> discussed upside down and backwards problem that has been corrected...

Just upside down in quartz(type= "pdf").

> The quartz help now includes:
> "Off-screen output types produce output files and utilize the file argument.
> type = "pdf" gives PDF output. The following bitmap formats may be supported
> (on OS X 10.4 and later): "png", "jpeg", "jpg", "jpeg2000", "tif", "tiff",
> "gif", "psd" (Adobe Photoshop), "bmp" (Windows bitmap), "sgi" and "pict".
> (The availability of some formats is OS-version-dependent.)"

Yes, I can read the help (I even wrote some of that)!  If by 'previous' 
you mean in 2.6.2, it was a different quartz device and quartz.save() did 
not use dev.copy (it was part of the R.app GUI's quartz() device).

So I don't see your point.  Mine was that I added "quartz" options to e.g 
png() because quartz(type = "png") worked at that point, but not to 
dev.copy2pdf() because quartz(type = "pdf") produced useless output at 
that time.

BDR

>
> This is using the latest R 2.7.0 r45298 and R GUI(5074)
>
> Best wishes,
>
> Todd
>
>
> On 4/15/08 Tuesday, April 15, 2008,12:27 AM, "Prof Brian Ripley"
> <ripley at stats.ox.ac.uk> wrote:
>
>> On Mon, 14 Apr 2008, Todd A. Johnson wrote:
>>
>>> Hi Peter & Ricardo
>>>
>>> The same thing can be done in 2.7.0 with:
>>>
>>> quartz(type="pdf", file="/Users/username/wherever")
>>> plot(0,0)
>>> dev.off()
>>>
>>> help(quartz) for additional options
>>
>> I don't think so: that does not save the current plot.  You could adapt
>> dev.copy2pdf() to come very close (or just use it -- R's pdf device will
>> copy well enough unless you need exotic fonts).
>>
>> I think the changes needed are from
>>
>>      oc$device <- pdf
>>      oc$onefile <- FALSE
>>      if (is.null(oc$paper))
>>          oc$paper <- "special"
>> to
>>      oc$device <- quartz
>>      oc$type <- "pdf"
>>
>> but I'm not sitting in front of a Mac.
>>
>> (Had quartz(type="pdf") been working at feature freeze for 2.7.0 we might
>> have made this an option in dev.copy2pdf, but it was broken until
>> recently.)
>>
>>>
>>>
>>> Best wishes,
>>>
>>> Todd
>>>
>>>
>>> On 4/14/08 Monday, April 14, 2008,4:18 PM, "[Ricardo Rodriguez] Your XEN ICT
>>> Team" <webmaster at xen.net> wrote:
>>>
>>>> Hi Peter, all,
>>>>
>>>> Peter Cowan wrote:
>>>>> Hello all,
>>>>>
>>>>> I'm having trouble with the quartz.save(), I know this is an
>>>>> undocumented function, and perhaps it is to be removed in 2.7.0.
>>>>> However, I find it very useful though I have been having trouble with
>>>>> it lately.
>>>>>
>>>>> Specifically, I get:
>>>>>
>>>>>
>>>>>> quartz()
>>>>>> plot(0,0)
>>>>>> quartz.save('temp.pdf')
>>>>>>
>>>>> Error in .Call("QuartzSaveContents", device, file, type, list(...)) :
>>>>>   C symbol name "QuartzSaveContents" not in load table
>>>>>
>>>>> I know that quartz.save() has been discussed recently on the list, but
>>>>> I didn't see this particular issue addressed.
>>>>>
>>>>> Thanks
>>>>>
>>>>> Peter
>>>>>
>>>>> R GUI r5072
>>>>
>>>> I'm getting exactly the same behavior here. Same R.app GUI, r5072,
>>>> version.string R version 2.7.0 beta (2008-04-12 r45280).
>>>>
>>>> And I also find this function really useful. Sorry, I've not followed
>>>> previous discussions, so I am not aware of possible alternatives. Accept
>>>> my apologies if they are quite obvious.
>>>>
>>>> Thanks,
>>>>
>>>> Ricardo
>>>
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> R-SIG-Mac at stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>>
>
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-SIG-Mac mailing list