Eric Fruits
2003-Mar-06 18:08 UTC
[R] Followup: copy-paste graphics from R to Word on Mac OS X
After trying numerous options, I'm just about at my wits end. The most frequent suggestion was to export to a postscript or PDF file and import that into Word. However, no matter what I did or how I did it, the results were extraordinarily ugly and somewhat time-consuming. What I've tried so far: 1. Copy and paste from the R graphics output window into Word (in Mac OS X), this is the worst result. 2. Use pdf() to create a pdf file, then import (Insert | Picture | From File ...) into Word. This generated the second-worst results. Note, that if I print the .pdf file without importing, the results are OK. 3. Use pdf() to create a pdf file, use MacGSView to convert to .tiff, then import into Word. This provided the third-worst results. Note that the .tiff file is jaggy too. 4. Use pdf() to create a pdf file, use the full-blown version of Acrobat to convert to .tiff, then import into Word. This provided the best, but still ugly results. Note that the .tiff file is jaggy too. It is conceivable that this is a Mac OS X problem, but I'm not convinced considering how well it handles other graphics. Any suggestions are appreciated. Begin forwarded message:> From: Eric Fruits <fruits at portland.econw.com> > Date: Fri Feb 21, 2003 10:32:52 AM US/Pacific > To: r-help at lists.R-project.org > Subject: Copy-paste graphics from R to Word on Mac OS X > > Greetings: > > I'm (very) new to R. > > One of the features of R that I really like is R's ability to quickly > generate very good looking graphics. However, I've noticed that when > I attempt to copy and paste the graphs from the R graphics output > window into Word (in Mac OS X), the resulting picture is very jaggy. > > I'm aware of the various options such as dev2bitmap, but I'd really > like to be able to do a quick copy and paste without switching among > various applications or creating extraneous files. > > Thanks. > > -- > Eric Fruits, Ph.D. > Senior Economist & Project Manager > ECONorthwest - Portland >
Jason Turner
2003-Mar-06 18:46 UTC
[R] Followup: copy-paste graphics from R to Word on Mac OS X
On Thu, Mar 06, 2003 at 10:08:34AM -0800, Eric Fruits wrote: [four permutations on pdf() snipped] Have you tried other graphics drivers? help(png) and help(jpeg) might be other options. I'd suggest playing with the "height" and "width" options. It sounds like Word for OS-X makes whatever you're importing into a bitmap, and does a bad job of it. Starting with a non-vector format at large resolution might make for some huge Word documents, but might make the pictures prettier. Cheers Jason -- Indigo Industrial Controls Ltd. 64-21-343-545 jasont at indigoindustrial.co.nz
Wiener, Matthew
2003-Mar-06 18:50 UTC
[R] Followup: copy-paste graphics from R to Word on Mac OS X
I've found Word imports png pretty well. David Brahm recently suggested playing with the resolution and so on -- you could look it up in the mail list archives -- but I've gotten acceptable results (on simple graphs) with the defaults. Hope this helps, Matt Wiener -----Original Message----- From: Eric Fruits [mailto:fruits at portland.econw.com] Sent: Thursday, March 06, 2003 1:09 PM To: r-help at stat.math.ethz.ch Subject: [R] Followup: copy-paste graphics from R to Word on Mac OS X After trying numerous options, I'm just about at my wits end. The most frequent suggestion was to export to a postscript or PDF file and import that into Word. However, no matter what I did or how I did it, the results were extraordinarily ugly and somewhat time-consuming. What I've tried so far: 1. Copy and paste from the R graphics output window into Word (in Mac OS X), this is the worst result. 2. Use pdf() to create a pdf file, then import (Insert | Picture | From File ...) into Word. This generated the second-worst results. Note, that if I print the .pdf file without importing, the results are OK. 3. Use pdf() to create a pdf file, use MacGSView to convert to .tiff, then import into Word. This provided the third-worst results. Note that the .tiff file is jaggy too. 4. Use pdf() to create a pdf file, use the full-blown version of Acrobat to convert to .tiff, then import into Word. This provided the best, but still ugly results. Note that the .tiff file is jaggy too. It is conceivable that this is a Mac OS X problem, but I'm not convinced considering how well it handles other graphics. Any suggestions are appreciated. Begin forwarded message:> From: Eric Fruits <fruits at portland.econw.com> > Date: Fri Feb 21, 2003 10:32:52 AM US/Pacific > To: r-help at lists.R-project.org > Subject: Copy-paste graphics from R to Word on Mac OS X > > Greetings: > > I'm (very) new to R. > > One of the features of R that I really like is R's ability toquickly> generate very good looking graphics. However, I've noticed that when > I attempt to copy and paste the graphs from the R graphics output > window into Word (in Mac OS X), the resulting picture is very jaggy. > > I'm aware of the various options such as dev2bitmap, but I'd really > like to be able to do a quick copy and paste without switching among > various applications or creating extraneous files. > > Thanks. > > -- > Eric Fruits, Ph.D. > Senior Economist & Project Manager > ECONorthwest - Portland >______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help ------------------------------------------------------------------------------
Martin Renner
2003-Mar-06 19:21 UTC
[R] Followup: copy-paste graphics from R to Word on Mac OS X
I had the same problem and came to this solution: - use pdf() to create a pdf file - open PDF in Freehand, during open replace fonts: ZapfDingsbat for Zapf Dingsbat - save as PDF or EPS and import this into word - bingo The pdf files created by pdf() seem less than perfect - on my system (Mac OS X) Illustrator refuses open these files and in Preview or Word any axis label disappear. Maybe someone here knows enough about the PDF format to suggest how to fix this rather complicated path. Martin
ripley@stats.ox.ac.uk
2003-Mar-06 20:05 UTC
[R] Followup: copy-paste graphics from R to Word on Mac OS X
This is misinformation: the font name in the PDF specifications is ZapfDingbats, and that is what the R driver uses, as in << /Type /Font /Subtype /Type1 /Name /F6 /BaseFont /ZapfDingbats>>I hope you have sent a suitable bug report to the supplier of your tools.x On Thu, 6 Mar 2003, Martin Renner wrote:> I had the same problem and came to this solution: > > - use pdf() to create a pdf file > - open PDF in Freehand, > during open replace fonts: ZapfDingsbat for Zapf Dingsbat > - save as PDF or EPS and import this into word - bingo > > The pdf files created by pdf() seem less than perfect - on my system > (Mac OS X) Illustrator refuses open these files and in Preview or > Word any axis label disappear. Maybe someone here knows enough about > the PDF format to suggest how to fix this rather complicated path.-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Seth Falcon
2003-Mar-06 23:18 UTC
[R] Followup: copy-paste graphics from R to Word on Mac OS X
I've encountered some of the same issues with jaggy graphics. Here is what I have found to work pretty well: Short and sweet: Use the bitmap() function with res=200 to create png files. Some explaination: As far as I can tell, png(), jpg(), and friends do not allow you to set the resolution. However, you can set the resolution using bitmap(). I've had good results with res=200. The tricky part about using bitmap() is that it relies on having GhostScript installed and may require you to set an environment variable (Will this have any chance of working on a Mac?) On my Windows 2000 system, I have R_GSCMD = c:\gs\gs8.00\bin\gswin32c.exe I can then create a png image that looks decent like this: fname <- "sineWave.png" x <- seq(0,6.5, .1) y <- sin(x) bitmap(file=fname, type="png256", width=4, height=4, res=200) dev.off() Final note: If you want to automate plot creation, you may need to utilize the Sys.sleep() function. If you call a script like this: rterm --slave --no-save --no-restore < autoPNGplot.r then R may complete before GhostScript gets a chance to start and GhostScript will crash because it can't find the files it was told to process. Sleeping for a few seconds seems to take care of this. You can test this yourself by trying to run the above sine wave script redirected into rterm. For me it crashes unless I add Sys.sleep(2) at the end. Hope these notes are somewhat helpful. + seth
Ulises Mora Alvarez
2003-Mar-08 01:08 UTC
[R] Followup: copy-paste graphics from R to Word on Mac OS X
Eric: I'm working with R in an IBook with Jaguar 10.2.4. When it comes to ghapics manipulation the best thing for me (and I mean a real good result) was to save my graphics either as bitmaps or as png's files with the "bitmap" or the "png" devices, respectively. Example: x <- 1:10 y <- 11:20 plot(x,y) dev.print(bitmap, file = "dummy.bmp", res = 600) I should tell you that I've compiled R using fink. I've to download a bunch of additional software (X11, ghoscript, etc., always using fink). But the results are just great. Have a look at the list files, and at the "Devices" help in the R software. If you need additional help with graphics or fink please let me know. Regards. On Thu, 6 Mar 2003, Eric Fruits wrote:> After trying numerous options, I'm just about at my wits end. > > The most frequent suggestion was to export to a postscript or PDF file > and import that into Word. > > However, no matter what I did or how I did it, the results were > extraordinarily ugly and somewhat time-consuming. > > What I've tried so far: > > 1. Copy and paste from the R graphics output window into Word (in Mac > OS X), this is the worst result. > > 2. Use pdf() to create a pdf file, then import (Insert | Picture | > From File ...) into Word. This generated the second-worst results. > Note, that if I print the .pdf file without importing, the results are > OK. > > 3. Use pdf() to create a pdf file, use MacGSView to convert to .tiff, > then import into Word. This provided the third-worst results. Note > that the .tiff file is jaggy too. > > 4. Use pdf() to create a pdf file, use the full-blown version of > Acrobat to convert to .tiff, then import into Word. This provided the > best, but still ugly results. Note that the .tiff file is jaggy too. > > It is conceivable that this is a Mac OS X problem, but I'm not > convinced considering how well it handles other graphics. > > Any suggestions are appreciated. > > Begin forwarded message: > > > From: Eric Fruits <fruits at portland.econw.com> > > Date: Fri Feb 21, 2003 10:32:52 AM US/Pacific > > To: r-help at lists.R-project.org > > Subject: Copy-paste graphics from R to Word on Mac OS X > > > > Greetings: > > > > I'm (very) new to R. > > > > One of the features of R that I really like is R's ability to quickly > > generate very good looking graphics. However, I've noticed that when > > I attempt to copy and paste the graphs from the R graphics output > > window into Word (in Mac OS X), the resulting picture is very jaggy. > > > > I'm aware of the various options such as dev2bitmap, but I'd really > > like to be able to do a quick copy and paste without switching among > > various applications or creating extraneous files. > > > > Thanks. > > > > -- > > Eric Fruits, Ph.D. > > Senior Economist & Project Manager > > ECONorthwest - Portland > > > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >-- Ulises M. Alvarez LAB. DE ONDAS DE CHOQUE FISICA APLICADA Y TECNOLOGIA AVANZADA UNAM umalvarez at fata.unam.mx