[R-SIG-Mac] Instructions for graphics (was Wiki or Development for Mac-R.app-graphics-insert-to-Word?)

David Nelson nelson6 at llnl.gov
Tue Jan 30 17:16:04 CET 2007

MHH Stevens is approximately correct: the ambiguity is in the verb  

Later versions of Office have a pdf importer, but
1) the graphic is imported as bitmap graphics, not vector graphics, and
2) the results are low-res, ugly, and often not correct.

As for Word's native vector graphics format on the Mac, I believe it  
is an older version quickdraw, dating from pre-OS X days.

The problem with this format has always been that  conversion from  
wmf/emf to quickdraw is woefully incomplete (just try rotating text :-)

My solution has always been to create a high-res high-quality jpeg  
and import that.

Hope this helps,

David Nelson

On Jan 30, 2007, at 1:41 AM, stefano iacus wrote:

> On 30/gen/07, at 10:35, MHH Stevens wrote:
>> Hi Folks,
>> later today, I plan on posting a web page of the following (with
>> formatting to make it legible). I thought you might be interested in
>> this, and may have specific comments for improvement.
>> How To Get Graphics Out of R and Into Microsoft Word and PowerPoint
>> This document describes a little of the how's and why's of getting
>> graphics out of R and into MS Word and PowerPoint. It is also how to
>> get graphics into the Open Office Suite and NeoOffice on a Mac.
>> Please consider suggestions for improvements to this document.
>> Mac OSX uses PDF format for vector-graphics format, and R can make
>> PDFs beautifully -- try opening them in Preview or Acrobat Reader.
>> Microsoft Word, however, cannot handle PDF graphics, and uses EMF/WMF
>> format for vector graphics. On PC's, R can create EMF/WMF format, but
>> it does not do so on Macs.
> up to my knowledge, this is untrue (or maybe not completely correct),
> word for Mac has an integrated WMF converter which does the job on-
> the-fly when you try to open a MSWindows generated graphics and
> inserted into Word.
> stefano
>> Note that if you make a Word document (like a manuscript) that
>> contains EMF/WMF graphics, Word on the Mac cannot read graphics in  
>> the
>> Word file made on the PC.
>> My Motivation
>> While I do not use Microsoft Word for my own work, I
>> (i) I teach R to people who use Word and PowerPoint, and
>> (ii) many people who use Word around here would also like to use R,
>> but are frustrated about getting graphics into Word.
>> How to do it
>> Step 1.
>> Learn about how to save graphics in R. Graphics are "graphics
>> devices" that can be saved as files in a variety of formats,
>> including PDF, PNG, PS, BMP, JPEG. Read the Mac R FAQ on quartz. Read
>> up on ?quartz, ?bitmap, ?pdf. You might also be interested to see
>> also ?postscript, ?jpeg.
>> Step 2.
>> Try following these instructions.
>> Use bitmap()
>> (I am not sure if this will work on computers without ghostscript - I
>> would be interested to find out!)
>>     1. Save R graphic with bitmap, using a high resolution. I prefer
>> 400 dpi, but others suggest 300 dpi suffices.
>>        plot(1:8)
>>        dev.print(bitmap, "Myplot.png", res=400)
>>     2. Within MS Word, use the Insert:Picture:From File to add it
>> into a Word document.  That will look very good.
>> Use an intermediate program.
>>     1. Save R images as PDFs
>>        plot(1:8)
>>        dev.print(pdf, "MyPlot.pdf")
>>     2. Open the file in GraphicConverter (a utility that comes with a
>> Mac), or Preview (Apple's PDF viewer), and then save as JPEG format
>> (with 100% resolution).
>>     3. Within MS Word, use the Insert:Picture:From File to add it
>> into a Word document.  That will look very good.
>> Cut and Paste
>>      * You can always cut and paste a quartz() window into Word, but
>> the image will be a little blurry. Other methods, including saving
>> using jpeg() and png(), also give less than ideal results.
>> I found a couple relevant threads including http://
>> finzi.psych.upenn.edu/R/Rhelp02a/archive/34950.html
>> Acknolwedgements
>> Thanks to all those who make R possible and who make R available on
>> the Mac. Thanks also to those who contributed to the above
>> information through the R-help listserv, including Stefan Iacus,
>> Simon Urbanek, Phillip Price, Ben Bolker, Byron Ellis, Federico
>> Calboli, Richard De Veaux, Don McQueen, Mick McQuaid, Rob Knell,
>> Brian Ripley, Duncan Murdoch, George Gilcrist. Thanks also to the
>> folks at Mozilla for providing the HTML composer on which this was
>> written. Please consider suggestions for improvements to the above
>> document.
>> On Jan 29, 2007, at 7:35 PM, Phillip Price wrote:
>>> On Jan 29, 2007, at 4:20 PM, MHH Stevens wrote:
>>>> Hi Phil,
>>>> I found res=400 was clean enough for me. The documentation says
>>>> something about needing ghostscript -- I have ghostscript, so I
>>>> don't know if it would work without it. Do you know?
>>>> -Hank
>>> I don't know.  I, too, have ghostscript.  I've never tried removing
>>> or hiding ghostscript and seeing if bitmap() still works.  I've
>>> wondered about this, but I've always figured that if, someday, I
>>> change my system and "break" bitmap(), I'll worry about it then.
>>> I'm glad it's working for you.
>>> --Phil
>> Dr. Hank Stevens, Assistant Professor
>> 338 Pearson Hall
>> Botany Department
>> Miami University
>> Oxford, OH 45056
>> Office: (513) 529-4206
>> Lab: (513) 529-4262
>> FAX: (513) 529-4243
>> http://www.cas.muohio.edu/~stevenmh/
>> http://www.muohio.edu/ecology/
>> http://www.muohio.edu/botany/
>> "E Pluribus Unum"
>> 	[[alternative HTML version deleted]]
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

David Nelson
nelson6 at llnl.gov

More information about the R-SIG-Mac mailing list