[R] which one give clear picture-pdf, jpg or tiff?

David Winsemius dwinsemius at comcast.net
Fri Aug 20 14:56:27 CEST 2010

On Aug 20, 2010, at 5:54 AM, (Ted Harding) wrote:

> On 20-Aug-10 09:24:17, Gavin Simpson wrote:
>> On Thu, 2010-08-19 at 20:32 -0700, Roslina Zakaria wrote:
>>> Hi,
>>> I need some opinion. I would like to use graph that I generate
>>> from R code and save it into word document. Whichformat is better?
>>> pdf, jpeg or tiff?
>> Not that I have used word for a while myself, but when I did EPS
>> files were my preferred format for Word docs that were to be printed
>> or converted to PDF. The only downside is that Word's EPS importer
>> displays a low resolution bitmap image of the EPS in the document
>> so things look pretty sketchy on screen. When printed, however,
>> EPS images will provide top quality. To achieve the same quality
>> with JPEG or TIFF would require a much larger image file and
>> consequently a much larger final document.
>> I still send my Word-using colleagues EPS files for papers we are
>> writing etc.
>> ?postscript for the options needed to produce correct EPS.
>> HTH
>> G
> I agree with Gavin about the relative merits of EPS and any bit-mapped
> format (such as jpeg or tiff). And also with Tim Gruene's earlier
> comment that "MS product are a little ignorant of PostScript and PDF":
> not only ignorant, but do not want to know!
> However, a further comment about "Word's EPS importer": You will
> only see on screen that "low resolution bitmap image of the EPS"
> when viewing the Word document IF the EPS file is in fact EPSI,
> i.e. it includes a "header" as PostScript Comments in the initial
> section which codes that bitmap for "preview" purposes. EPS files,
> *as such*, by default do not include this, and then you would only
> see on screen the outline box with nothing inside it. (The only
> requirement for a PS file to be EPS is the presence in the Comments
> of a "%%BoundingBox: ..." line).
> There is nothing about this that I can see in '?postscript', and
> running a test using
>  postscript("testEPS.eps")
>  plot(...)
>  dev.off()
> produced an EPS file with no such EPSI inclusion.


There is a paragraph in the postscript help page regarding EPS,  
including the advice to use setEPS thusly:

setEPS( horizontal = FALSE, onefile = FALSE, paper = "special")

.... and see if you get any better results. (After such incantations,  
I get this as a header.)

%!PS-Adobe-3.0 EPSF-3.0
%%DocumentNeededResources: font Helvetica
%%+ font Helvetica-Bold
%%+ font Helvetica-Oblique
%%+ font Helvetica-BoldOblique
%%+ font Symbol
%%Title: R Graphics Output
%%Creator: R Software
%%Pages: (atend)
%%BoundingBox: 0 0 504 504

I do have eventual access to MSWord but that would mean I needed to  
restart, start up Windows, etc. (Not motivated at the moment.)

> There are PostScript-handling program suites, such as ghostscript,
> which include a facility to convert from EPS to EPSI: in particular,
> ghostscript has the command ps2epsi.
> Ted.

David Winsemius, MD
West Hartford, CT

More information about the R-help mailing list