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

Gavin Simpson gavin.simpson at ucl.ac.uk
Fri Aug 20 12:37:50 CEST 2010


On Fri, 2010-08-20 at 10:54 +0100, Ted.Harding at manchester.ac.uk 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")

Don't you need onefile = FALSE in that call? An EPS should only contain
a single "page" or image.

Back in the day, when I was using word and R, R's EPS files were
imported without the preview (as R doesn't generate one). Later on, a
low resolution bitmap was being displayed. I presumed this was because I
was using a newer version of office. I generate EPS using
postscript(..., onefile = FALSE) and with no further processing, my
colleagues see the low res bitmap in Word.

Like I said, I don't use Word any more and am writing this from a Linux
box so can't check but that is my experience from working with
colleagues who do use Word.

G 

>   plot(...)
>   dev.off()
> produced an EPS file with no such EPSI inclusion.
> 
> 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.
> 
> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
> Fax-to-email: +44 (0)870 094 0861
> Date: 20-Aug-10                                       Time: 10:54:33
> ------------------------------ XFMail ------------------------------
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list