[R-SIG-Mac] How to put nice R graphics into powerpoint

Don MacQueen macq at llnl.gov
Fri Feb 11 23:34:56 CET 2005

I know this is not helpful for folks who don't have Illustrator, but 
as of today I got decent results using R's postscript() device to 
create an EPS file, opening it in Illustrator (v10), and exporting as 

The image, then imported into either Word 2004 or PowerPoint 2004 was 
decent, in the single example I tried. Certainly much better than 
using R's pdf() and then importing directly into Word or PP.

Watch out for encoding issues; believe it or not, specifying 
encoding='WinAnsi' in postscript() may give the best results.


At 1:42 PM -0800 2/11/05, Phillip Price wrote:
>>>I usually create a PDF with R, and import it into Powerpoint for 
>>>the mac.  The results are fuzzy and not good.  I don't have 
>>>Illustrator.  For final presentations I sometimes send the pdf to 
>>>a colleague who has Illustrator, who converts it for me.
>>It's better to use PhotoShop (if you have it) than Illustrator - AI 
>>doesn't handle objects with alpha component well and has some other 
>>quirks. PS rendered all graphics I had perfectly and allows 
>>flexible resolution settings and many more output formats.
>Good to know.  But I don't have PS either.
>>Other solution is to use R directly to produce hi-res bitmaps 
>>instead of PDF. You'll need to tweak the settings to get a good 
>>output, though.
>This is probably the way to go, actually.  Believe it or not, I had 
>not realized there was a way to make R produce bitmaps!
>>>   If, instead, the actual state of things is that R cannot produce 
>>>output that can be used well in the world's most popular 
>>>presentation software, then I think this should be a fairly 
>>>high-priority item.  (Of course, I say this from the standpoint of 
>>>someone who will not actually be doing the work to implement a 
>>>change, so, easy for _me_ to say)!
>>The fact is that R can produce "output that can be used well in the 
>>world's most popular presentation software" if you're using the 
>>"world's most popular" operating system. That is the reason why it 
>>becomes a very low priority item as your argument backfires ;).
>By that argument, why bother with R for Mac at all?
>Those of us who have colleagues on Windows with whom we need to 
>exchange Powerpoint slides are just in a bind, is all.  But the 
>bitmap() solution should work fine for me, now that I know about it! 
>(I have not yet played with it to check).
>>Finally some good news ;). After some tweaking and bug-fixing I was 
>>able to compile pstoedit and libEMF for OS X. The output isn't 
>>exactly great, but people who can live with PowerPoint won't notice 
>>or mind either, so there it goes:
>>That's the binary (statically linked, so nothing else needed). Just 
>>download, run
>>chmod a+x pstoedit
>>on it in Terminal after downloading and you're ready to go. It's a 
>>command-line tool, of course, and I highly recommend using the -pta 
>>flag. Furthermore due to the limitations of EMF format, you may be 
>>better off scaling the image to get somewhat more reasonable 
>>result, so you could use something like:
>>pstoedit -pta -xscale 16 -yscale 16 test.pdf test.emf
>>The reason why scaling makes a difference is that EMF uses integer 
>>precision and the grid of possible points is very coarse by default.
>Terrific!  Fantastic!  From a quick test, this works well.
>So to sum up: the bitmap() solution was always there, had I not been 
>too lazy to figure it out.  And now Simon has made an installer for 
>pstoedit, which also works fine for me.   Two good solutions to my 
>problem, one day after asking for them. That's what I call service! 
>I really appreciate this.
>>In conclusion I can't help but to say, get Keynote if you can
>I have it and like it, but it's not a great solution for me: I 
>frequently have to exchange slides with colleagues who use 
>Powerpoint.   For a while I prepared my own talks in Keynote and 
>exported to Powerpoint when I needed to, but there are some 
>drawbacks and hassles associated with that.  More than half of my 
>colleagues have switched to Mac now, but it will be hard to force a 
>switch to Keynote as the de facto standard for everyone.  I do hope 
>that in cases where I'm only dealing with my Mac-using colleagues, 
>we can make Keynote the lingua franca.
>Thanks again, Simon, for your help.
>--Phil Price
>R-SIG-Mac mailing list
>R-SIG-Mac at stat.math.ethz.ch

Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA

More information about the R-SIG-Mac mailing list