Skip to content

insert eps into microsft word

8 messages · Karim Elsawy, Marc Schwartz, Ben Bolker +5 more

#
it seems that word can not read encapsupalted postscripts generated by R
I used this command

postscript("output.eps",horizontal=F,onefile=TRUE)
since onefile=TRUE produces an encapsualted postscript

actually what I'm trying to do is to insert the postsript file into a
word document
since other formats like jpeg and bmp do not reproduce the same quality
like postscript
formats


any suggestions are very much appreciated
Karim
#
On Wed, 2003-09-10 at 12:12, Karim Elsawy wrote:
Try this syntax:

postscript("output.eps", horizontal = FALSE, onefile = FALSE, 
           paper = "special")

Take note of the instructions in the Details section of ?postscript and
also re-read the description of 'onefile' ('**' are my add):

"logical: if true (the default) allow multiple figures in one file. **If
false**, generate a file name containing the page number and use an EPSF
header and no DocumentMedia comment."

HTH,

Marc Schwartz
#
If you're working in windows, the WMF (windows metafile) format is 
probably your best bet; it's a vector format like PostScript.
On Wed, 10 Sep 2003, Karim Elsawy wrote:

            

  
    
#
You can also add a Windows metafile preview to your eps image using for 
instance Ghostscript.

Martin

On Wed, 10 Sep 2003 18:12:00 +0100, Karim Elsawy <elsawy at ysbl.york.ac.uk> 
wrote:

  
    
#
for word documents submitted to picky journals i usually use seomthing
like this:

bitmap("plot_1.png",width=6,height=6,res=600,pointsize=12,family="Times")

on my computer this resutls in quality  just as good (to mu eye) as with
postscript. you can also use adobe acrobat to convert postsctipt to
something else.
On Wed, 10 Sep 2003, Karim Elsawy wrote:

            
#
Depending on your version of Word that simply is *not* true!

I can't test this here (I now have Word XP/2002) but my colleagues have 
Word 97 on their college-supplied service (yes, really!) and despite not 
being able to see a preview, they can quite happily import eps files I 
have produced during the course of my work. Admitedly a blank box in 
word is not the most user-friendly thing to work with, but this old 
version of Word will happily deal with the postscript produced.

Having used Word 2000 and XP during the course of writing a PhD thesis 
that used R-generated plots extensively, I know first hand how easy it 
is to deal with eps files from R in Word.

My setup involves using Ghostscript/GSView on Windows XP to view the eps 
plots I produce in R and then import them into Word XP (the eps filter 
now seems to add a preview for you), but if you have an earlier word 
version, GSView can easily add a preview for you.

Also, onefile = TRUE does *not* produce eps files.

I quote from ?postscript :

  onefile: logical: if true (the default) allow multiple figures in one
           file.  If false, generate a file name containing the page
           number and use an EPSF header and no `DocumentMedia' comment.

It is a bit confusing, but onefile = TRUE is for producing multi-page 
postscript documents, i.e. put all the plots to follow into a single 
postscript doc with (possibly) more than a single page.

I know a number of people have suggested using a windows metafile. 
Whilst this might offer a solution to your problem, unless you are using 
a very-out-of-date version of Word I cannot see the advantages of using 
metafiles over postscript.

HTH

Gavin
Karim Elsawy wrote:

            

  
    
#
"Rafael A. Irizarry" <ririzarr at jhsph.edu> writes:
Word seems generally unhappy with PostScript, not just the files R
makes. One option that I have seen come out rather nicely is to have
the plots as PDF and use Adobe Distiller as the backend so that the
whole thing becomes a PDF file.
#
Your problem may also be that you can't get the figure to print from Word?

To get Word to print anything other than a blank box for the eps, you will
need to install and use a postscript printer driver for your printer.

cheers
Brett

Brett Melbourne, Postdoctoral Fellow
Biological Invasions IGERT www.cpb.ucdavis.edu/bioinv
Center for Population Biology, Storer Hall
University of California Davis CA 95616


----- Original Message ----- 
From: "Gavin Simpson" <gavin.simpson at ucl.ac.uk>
To: "Karim Elsawy" <elsawy at ysbl.york.ac.uk>
Cc: <r-help at stat.math.ethz.ch>
Sent: Wednesday, September 10, 2003 12:26 PM
Subject: Re: [R] insert eps into microsft word