Skip to content
Prev 166 / 7420 Next

Publication quality graphics in R

Hi Mark,

I second writing to files as David says, but I have a few things to add:

- jpg is meant to encode photos, and because of the compression it uses 
it will butcher complicated text, especially if you have to re-save 
multiple times, resize the images, etc...  PNG avoids this problem but 
still compresses photo-like images nicely (say colored 3-D plots).  MS 
Office will definitely accept PNG.

- postscript is probably best for simpler figures (I think MS Office 
accepts it happily) and journals should be happy to take it (?)

- when you open the PNG/pdf/postscript device for writing an image, it 
helps to already know what size/resolution the image needs to be because 
resizing will almost certainly alter the look of text. I tend to save 
data frames for making particular figures instead of saving images for 
this reason.

- I haven't had trouble with this, but the ?postscript help page 
mentions that if you use complex symbols, you need to make sure you have 
good fonts/encodings set for them--see the encodings section on 
?postscript...

- The R wiki has some good information on preparing images.

Hope that helps,

Krzysztof
Mark A. Albins wrote: