Re: win.metafile [RE: [R] insert eps into microsft word]
On Mon, 2003-10-06 at 19:21, Gabor Borgulya wrote: > 2003-09-10, sze keltezéssel David Khabie-Zeitoune ezt írta: > > 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() > > Hi! > > I could not run this example: > Error: couldn't find function "win.metafile" > > I am using Linux. Does this function only exist in the windows version > of R? Why? Does it need some functions of the OS itself? Can the Linux > version of R be invoked or compiled with a switch enabling WMF support? > > Eps is perfect for a paper, but I would need the same graphs in a MS > Power Point presentation es well. I tried OpenOffice, but it could not > import the eps image. > > Do I have to re-run my script on a windows PC? > > Gabor The WMF/EMF format is available on Windows only, since it depends upon Windows OS functionality. There is a WMF/EMF library for Linux (called libemf), but I can tell you from personal experience that it does a poor job quality-wise. There is discussion from the OpenOffice folks on the possibility of supporting SVG format imports possibly in version 2.x, but not before then. SVG would provide scalable vector format functionality (like WMF) for cross-platform support. But not yet. What I do is to generate an EPS file using R and import that in to OpenOffice. I can then print it to a PS file and if need be, use ps2pdf to create a PDF file version. The trick with R in creating EPS files is to follow the instructions under ?postscript very closely. OpenOffice will import R's EPS files if generated properly. Most importantly is to set the following arguments: horizontal = FALSE, onefile = FALSE, paper = "special" So a call to postscript might be: postscript("MyGraph.eps", horizontal = FALSE, onefile = FALSE, paper = "special") plot(...) dev.off() That being said, if you import the EPS file into OpenOffice, you will not see the image, unless you spend the time to create an image preview, which will be both poor quality and substantially increase the file size. You will only see a box with an "X" in it as a place holder. If you need to be able to actually see the slide in OpenOffice or PowerPoint, you would be best served (under Linux) to generate a PNG file. See ?png for more information. You need to specify the image size for your target so that you do not have to worry about re-sizing or you will lose image quality, since bitmap formats do not re-size well. Once you create the PNG file, you can then import that into OpenOffice. An alternative to the above approach would be to use bitmap(), which accomplishes the generation of the image file a bit differently using ghostscript. You might try both approaches to see what looks best to your eye. YMMV. HTH, Marc Schwartz __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: win.metafile [RE: [R] insert eps into microsft word]
On 07-Oct-03 Gabor Borgulya wrote: > I could not run this example: > Error: couldn't find function "win.metafile" > > I am using Linux. Does this function only exist in the windows version > of R? Why? Does it need some functions of the OS itself? Can the Linux > version of R be invoked or compiled with a switch enabling WMF support? > > Eps is perfect for a paper, but I would need the same graphs in a MS > Power Point presentation es well. I tried OpenOffice, but it could not > import the eps image. > > Do I have to re-run my script on a windows PC? If on Linux, install (if you have not already) ImageMagick. This can convert between all sorts of formats including (if your version supports it which mine doesn't) Windows Metafile. If it doesn't, you have options like GIF or JPEG which Windows can import. Admittedly they're basically bitmaps, so won't scale nicely if you have to increase their size, but they may well do nicely for your PP presentation. e.g.: convert file.eps file.jpg NB InageMagick is a suite of several programs, one of which is 'convert'. But, to find out what formats you might be able to convert between, see 'man ImageMagick'. And, to find out what formats you really have available, run convert -list format Hoping this helps, Ted. E-Mail: (Ted Harding) <[EMAIL PROTECTED]> Fax-to-email: +44 (0)870 167 1972 Date: 07-Oct-03 Time: 01:56:04 -- XFMail -- __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
win.metafile [RE: [R] insert eps into microsft word]
2003-09-10, sze keltezéssel David Khabie-Zeitoune ezt írta: > 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() Hi! I could not run this example: Error: couldn't find function "win.metafile" I am using Linux. Does this function only exist in the windows version of R? Why? Does it need some functions of the OS itself? Can the Linux version of R be invoked or compiled with a switch enabling WMF support? Eps is perfect for a paper, but I would need the same graphs in a MS Power Point presentation es well. I tried OpenOffice, but it could not import the eps image. Do I have to re-run my script on a windows PC? Gabor __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] insert eps into microsft word
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" <[EMAIL PROTECTED]> To: "Karim Elsawy" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, September 10, 2003 12:26 PM Subject: Re: [R] insert eps into microsft word > 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 > > > > __ > > [EMAIL PROTECTED] 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] [EMAIL PROTECTED] > 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. > %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% > > __ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] insert eps into microsft word
"Rafael A. Irizarry" <[EMAIL PROTECTED]> writes: > 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. 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. -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] insert eps into microsft word
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 __ [EMAIL PROTECTED] 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] [EMAIL PROTECTED] 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. %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] insert eps into microsft word
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 > > __ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] insert eps into microsft word
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 <[EMAIL PROTECTED]> 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 __ [EMAIL PROTECTED] 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] insert eps into microsft word
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 > Karim 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] insert eps into microsft word
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:[EMAIL PROTECTED] Sent: 10 September 2003 18:12 To: [EMAIL PROTECTED] 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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] insert eps into microsft word
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 > > __ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > -- 620B Bartram Hall[EMAIL PROTECTED] Zoology Department, University of Floridahttp://www.zoo.ufl.edu/bolker Box 118525 (ph) 352-392-5697 Gainesville, FL 32611-8525 (fax) 352-392-3704 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[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 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help