[R-SIG-Mac] Problems with savePlot() and postscript under Snow Leopard
dwinsemius at comcast.net
Sat Feb 13 21:11:50 CET 2010
On Feb 13, 2010, at 2:53 PM, David Winsemius wrote:
> On Feb 13, 2010, at 1:51 PM, Hannes Nietnagel wrote:
>> Dear all,
>> since my problem could not be solved in the general R mailing list,
>> I'll post the issue again in this specific mailing list.
>> I tried:
>>> species.n <- as.numeric(Species)
> It would help if yuo access the column properly. "Species" is only
> meaningful within "iris".
>>> plot(iris, col = species.n)
>>> savePlot(filename="IrisTestPlot", type="png")
> If you want a png plot then open the png() device and close it when
> you are done:
> species.n <- as.numeric(iris$Species)
> plot(iris, col = species.n)
> Produces the requested plot in the working directory and Preview
> opens it without problem.
I also got a slightly different sort of success with:
plot(iris, col = species.n)
The background was completely transparent. I can see useful
application of that feature in creating "after-the-fact" overlays of
other plots. Reviewing the help page for ?quartz, it appears this is
the expected result. Plotting with the png() device created a white
background (as would be expected after reading its help page.)
>> and got the error message:
>> Fehler in savePlot(filename = "IrisTestPlot", type = "png") :
>> kann nur aus 'X11(type="*cairo")' Devices kopieren
>> (sorry, I have a german version of R).
>> I tried:
>>> postscript(file="IrisTestPlot2.pdf", onefile = FALSE, horizontal =
>>> FALSE, paper = "special", width = 8, height = 8)
>> in both cases there are files produced that cannot be opened. Error
>> message: the bounding box is missing.
>> According to Michael's advice I tried:
>> and got:
>> but no file.
>> as well as:
>>> system('open IrisTestPlotquartz.png')
>> It states that the files does not exist.
>> And I tried:
>> And got the answer:
>> and again no file.
>> I use 64 bit R under Snow Leopard.
>> R version 2.10.1 (2009-12-14)
>>  de_DE.UTF-8/de_DE.UTF-8/C/C/de_DE.UTF-8/de_DE.UTF-8
>> attached base packages:
>>  stats graphics grDevices utils datasets methods base
>> loaded via a namespace (and not attached):
>>  tools_2.10.1
>> What could be the problem and how can I solve it?
>> Thank you very much in advance for your time and advices!
>> R-SIG-Mac mailing list
>> R-SIG-Mac at stat.math.ethz.ch
> David Winsemius, MD
> Heritage Laboratories
> West Hartford, CT
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
David Winsemius, MD
West Hartford, CT
More information about the R-SIG-Mac