[R-SIG-Mac] Saving pdf with transparent background

Gerald Jurasinski terhorab at mac.com
Tue May 20 13:32:14 CEST 2008


Dear List,

Usually I save my current graphics device window to a pdf file. Before  
2.7.0 the resulting file was with transparent background (as desired)  
when I set bg="transparent" for the current on-screen graphics device  
before plotting.

Now this is different. I already read about the new quartz device in  
the help file. And as far as I understood, only the canvas is supposed  
to be opaque and not the background of the plot (at least when it is  
set to "transparent" via par(bg="transparent") or via  
quartz(bg="transparent")). So when it comes to saving the plot from  
the current on-screen graphics device I expect the resulting graphic  
file to have a transparent background. This was the former behavior  
(until 2.6.2). But now the background color of the canvas seems to be  
taken as the background of the resulting pdf.

Only with quartz.save() I can get a transparent background. Is there a  
possibility to save the active on-screen graphics device to a file  
with transparent background? Even better would be the possibility to  
cmd-c / cmd-v a plot with transparent background to use in other  
applications (e.g. keynote and such).

Thanks for your help.
Best regards

Gerald

I'm running R on a MBP 2.2GHz C2D with Mac OS 10.5.2

 > sessionInfo()
R version 2.7.0 (2008-04-22)
i386-apple-darwin8.10.1

locale:
de_DE.UTF-8/de_DE.UTF-8/C/C/de_DE.UTF-8/de_DE.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] simba_0.2-5   plotrix_2.4-1 geoR_1.6-21   sp_0.9-25     gplots_2.6.0
[6] gdata_2.4.1   gtools_2.4.0  vegan_1.11-4

loaded via a namespace (and not attached):
[1] grid_2.7.0     lattice_0.17-6 tools_2.7.0

——————————————————

gerald jurasinski
fahnenstraße 8
18057 rostock
terhorab at mac.com
+49 381 8774550



More information about the R-SIG-Mac mailing list