[R-SIG-Mac] image() to Rplot.pdf

Simon Urbanek simon.urbanek at r-project.org
Tue Jan 20 16:40:48 CET 2009


Paul,

On Jan 20, 2009, at 9:56 , Paul J. Ossenbruggen wrote:

> Hi Simon,
>
> 	Thank you for the information about the R image rendering issue in  
> Preview and Acrobat. I am happy to learn that my problem is not  
> related to R and Quartz.
>
> 	As you suggested, I zoomed in and out with Preview but the white  
> lines did not disappear entirely. However, this is OK for the type  
> of analysis that I have performed.
>
> 	The real problem that I have is converting it to a tiff file. I  
> must submit a tiff file to the journal where the image will be  
> published. When I use Preview for conversion, the image looks like a  
> Scottish  plaid. The white lines are there but they look they are  
> part of the plaid.
>
>
> 	Acrobat, on the other hand, is totally unacceptable. The image  
> shading disappears entirely and a series of dots appear within the  
> map boundary. The legends have no shading what so ever, thus  
> converting it to a tiff file won't work. I have successfully use  
> this method for transforming color R images in pdf to tiff.
>
>
> 	Question: Is it possible to export or convert a R image directly to  
> a tiff file without going Preview?
>

Sure, that's easily done using Quartz directly:
quartz.save("foo.tiff",type="tiff")

For a journal you may want to increase the dpi, e.g.:
quartz.save("foo.tiff",type="tiff",dpi=300)

Since Quartz knows that you're generating a bitmap it will snap the  
pixel boundaries for rectangles accordingly.

If you don't want a transparent background, you can use Quartz  
directly to do the drawing and force bg="white":

quartz(file="foo.tiff",type="tiff",dpi=300,bg="white")
# do your plotting here ... (you can also set width/height above see ? 
quartz)
dev.off()

Cheers,
Simon



More information about the R-SIG-Mac mailing list