An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20090120/f3c84fa9/attachment.pl>
image() to Rplot.pdf
3 messages · Paul Ossenbruggen, Simon Urbanek, Brian Ripley
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
On Tue, 20 Jan 2009, 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
Why? R has several tiff() devices, so why are you shunning them?
submit a tiff file to the journal where the image will be published. When I use Preview for conversion,
Not a good idea. Use ghostscript if you must, via bitmap() (and make sure antialiasing is off there).
the image looks like a Scottish plaid. The white lines are there but they look they are part of the plaid.
Hmm, what is 'Scottish' about it?
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? Thank you, Paul
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