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
Have you tried win.metafile (I'm assuming you are using Windows)? E.g. win.metafile(file = "c:/test.wmf") plot(rnorm(100)) dev.off() WMF is a vectorised format (unlike jpeg or bmp) so should produce nice scalable graphs. -----Original Message----- From: Karim Elsawy [mailto:elsawy at ysbl.york.ac.uk] Sent: 10 September 2003 18:12 To: r-help at stat.math.ethz.ch Subject: [R] insert eps into microsft word 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 ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
On Wed, 2003-09-10 at 12:12, Karim Elsawy wrote:> 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 > KarimTry 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:> 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 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >-- 620B Bartram Hall bolker at zoo.ufl.edu Zoology Department, University of Florida http://www.zoo.ufl.edu/bolker Box 118525 (ph) 352-392-5697 Gainesville, FL 32611-8525 (fax) 352-392-3704
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:> 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 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > >-- Martin Biuw Sea Mammal Research Unit Gatty Marine Laboratory, University of St Andrews St Andrews, Fife KY16 8PA Scotland Ph: +44-(0)1334-462637 Fax: +44-(0)1334-462632 Web: http://smub.st.and.ac.uk
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:> 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 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >
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:> 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 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > >-- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Gavin Simpson [T] +44 (0)20 7679 5522 ENSIS Research Fellow [F] +44 (0)20 7679 7565 ENSIS Ltd. & ECRC [E] gavin.simpson at ucl.ac.uk UCL Department of Geography [W] http://www.ucl.ac.uk/~ucfagls/cv/ 26 Bedford Way [W] http://www.ucl.ac.uk/~ucfagls/ London. WC1H 0AP. %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%