Skip to content

How to put nice R graphics into powerpoint

16 messages · Denis Chabot, Thomas Lumley, Andrew Beckerman +5 more

#
Hi,

I really like the nice vector-based pdf graphics I get in R.

However, PowerPoint seems to be unable to read them as vector graphics 
and rasterizes them, making them quite "fuzzy" and ugly. Granted, the 
problem lies with Microsoft, but in the mean time what is the best 
workaround? I'd like to do better than producing png from within R 
(especially that only my iMac has X11, my very old PowerBook does not).

I am still able to show vector graphics in pict format in PowerPoint. 
So it should be possible to extract the vectorized plot from the pdf 
and save it as pict, still vectorized.

However opening the R-produced pdf in Illustrator and saving as pict 
produces a file quite a bit bigger than the original pdf, suggesting it 
was saved as raster pict instead of vector pict. It shows up in 
Powerpoint just as ugly as if it was inserted directly as pdf. This is 
true with Illustrator CS (aka v11 I think) used either under 10.2.8 or 
10.3.7. It is also true when using GraphicConverter 5 and Preview 
(Jaguar's version, I think it is also true with the Panther version) to 
go from pdf to pict.

I fired up Canvas (old, version 8) and it did manage to save something 
that was vectorized (i.e. very sharp when viewing at 400% in 
PowerPoint) but the empty circles I used as symbols were not filled 
blacks, the dashes of dashed lines had become "wiggly", text 
orientation was unacceptably changed, etc. etc.

So does anyone know of a technique to produce vector graphics that 
insert nicely in PowerPoint, either directly from R or by converting a 
pdf produced by R into something else?

Sincerely,

Denis Chabot
#
On Thu, 10 Feb 2005, Denis Chabot wrote:

            
After similar struggles I have resorted to PNG for insertion in PowerPoint 
on the Mac. At, say, 500x600 pixels, PNG works quite nicely even though it 
isn't a vector format.

(I've also used PNG in LaTeX-based presentations for plots that would 
otherwise take several seconds for Preview to render. The results are 
better in LaTeX, but ok in PowerPoint).

 	-thomas
#
Denis - I use the following rather convoluted method with OS 10.3.8,  
Illustrator CS, and R2.0.1.

command-c copies a figure from the quartz window.  Open this file in  
preview and export it as a pdf file (don't know why i do this....).   
use illustrator, and the command <place> from the file menu to insert  
it in a new document.  Choose <save for microsoft office> from the file  
menu in illustrator. this produces a png file that plays nicely, cross  
platform, with Word and PP. variations abound, but the goal is to get  
something presentable in illustrator and use its save for office  
option.....

I noticed that preview has a png choice from export, but I've not yet  
played around with its options to see if I can get the same quality  
that the save for Microsoft Office option produces in Illustrator.

Cheers
andrew
On 10 Feb 2005, at 15:50, Denis Chabot wrote:

            
------------------------------------------------------------------------ 
---------
Dr. Andrew Beckerman
Department of Animal and Plant Sciences, University of Sheffield,
Alfred Denny Building, Western Bank, Sheffield S10 2TN, UK
ph +44 (0)114 222 0026; fx +44 (0)114 222 0002
http://www.shef.ac.uk/beckslab
------------------------------------------------------------------------ 
----------
#
Thank you Andrew and Thomas,

I have used png produced by Illustrator in much the way you described  
and the results were not very good. I'll try again because I don't  
remember if I was given an option to chose the overall size in pixels.  
If I can, then I'll increase the count. Alternatively, on my iMac at  
home where R11 is installed, I'll resort to saving directly in png but  
increasing the pixel count, as suggested by Thomas.

Still, if the information in the pdf produced by R is vector based (it  
is still perfectly sharp when viewed at 1600% in Acrobat), why can't I  
find a way to transform such pdf in vector-based pict? That format must  
be able to handle such plots. After all, I also make plots in  
KaleidaGraph, and they were very small vector-based pict files. They  
looked gorgeous in Powerpoint at any zoom setting. I also use Aabel  
which gives you the option of saving plots as pdf or pict. I chose the  
later when I need to insert in PowerPoint, and the former for LaTeX.  
Quality is good either way. Maybe I'll check if there is a "graphics"  
discussion on Apple's site. If I manage to learn something useful I'll  
report back.

Denis
Le Jeudi, 10 f?vr 2005, ? 17:13 Europe/Paris, Andrew Beckerman a ?crit :
#
You can load the pdf file produce by R in the standard Previewer of Mac  
OS X and export to (almost) whatever format you like including bitmaps


stefano
On Feb 10, 2005, at 5:29 PM, Denis Chabot wrote:

            
#
Hi Stefano,

Bitmaps is what I'd like to avoid.

Preview seems to be using QuickTime for the translation from pdf to  
pict, and the result is bitmap. Too bad though.

Denis
Le Jeudi, 10 f?vr 2005, ? 18:05 Europe/Paris, stefano iacus a ?crit :
#
On Feb 10, 2005, at 6:10 PM, Denis Chabot wrote:

            
yes, but as Thomas pointed out png is not that bad even with LaTeX.  
What kind of vectorial format does PowerPoint support (if any) ?

I'm not used to PowerPoint, but for example, with KeyNote (the apple  
counterpart) you can use pdf graphics directly and you still have an  
option to export the slides in PowerPoint.
Could this be another solution?

stefano
#
Denis Chabot wrote:
well, if you can afford it: the Power Point look-alike from apple 
("Keynote") can usually import _and_ export .ppt files (so you can at 
least use what you already have). but if you present your results with a 
mac (and with Keynote) your problem is solved, since you can simply drag 
adn drop your pdf file into the keynote slides which keeps it as such 
(i.e. vector graphics). all in all keynote (if it survives...) seems to 
be a much nicer thing than power point.
#
Hi Denis,
On Feb 10, 2005, at 10:50 AM, Denis Chabot wrote:

            
AFAICS there is no way to include vector graphics into PP other than 
WMF (and I didn't even test that on a Mac).

OT: Get Apple Keynote - it's far better, pastes such PDFs in vector 
form flawlessly and it even supports copy/paste of Latex formulas in 
vector form (via LaTeX Equation Editor)! There are plenty output 
formats if you really need to present it on a PC, too...

Cheers,
Simon
#
Hi All,

My guess is the supported vector format is Windows enhanced meta file,
which R for Windows will produce. Unfortunately, Microsoft Office is the
one thing most of us can't get away from, try as we might. As a result,
an argument could be made to have a device for this format on the Mac
side if the Windows code could easily be ported.

Dan
On Thu, 2005-02-10 at 09:20, stefano iacus wrote:
#
I would love to get Keynote, but it is not compatible with my old 
powerbook. As my employer had put a freeze on computer purchases 
because of budget constraints (and because buying a Mac where I work is 
a big struggle, as I'm seen as a thorn in the (chose your soft spot) of 
the IS guys who'd love to have a 100% Windows universe, but that's 
another story) it is not an option (yet).

Actually in recent versions of PowerPoint wmf usually display properly 
and very sharp. In a presentation I gave yesterday the only sharp 
graphs came from wmf maps I produced with Surfer on a Windows machine, 
what a shame!

But I can certify that PowerPoint always allowed vector pict format.

For now I'll have to resort on running some R programs a second time 
and save higher resolutions png than what Preview and Illustrator give 
me when they translate pdf into png.

Denis

Le 10 f?vr. 2005, ? 18:56, Simon Urbanek a ?crit :
#
Well it would be more logical for Microsoft to support pdf! I've  
certainly complained loud enough, but I don't count on them doing  
something for me. Unless pdf becomes important on Windows, I suppose.

As for a R-based solution, a pict device would solve my problem just as  
well as a wmf device.

Denis
Le 10 f?vr. 2005, ? 19:04, Dan Putler a ?crit :
#
On Feb 10, 2005, at 1:04 PM, Dan Putler wrote:

            
Unfortunately it cannot be easily ported, because creating WMF in Win 
is trivial - Windows generates it for you (more precisely you draw the 
same way as if it was screen or printer - actually the same way you get 
PDF on a Mac ;)). Since it's Windows creating the WMF and not R, you 
cannot port it unless you  implement what Windows does...

I was looking into generating WMF from scratch long time ago and at 
that time there was no (non-commercial) library for writing WMF files. 
At that point libwmf was strictly read-only and I didn't check whether 
they added write-support which was planned for the future .. [btw: I'm 
using WMF here in the sense of both EMF and WMF]. If no one else 
tackles this and I have a spare minute, I 'll have a look if we can 
cook anything out of that ...

Cheers,
Simon
#
On Feb 10, 2005, at 1:11 PM, Denis Chabot wrote:

            
Definitely, but M$ never does anything based on whether it makes sense 
- they do whatever will tie their users even more to M$ - which is 
keeping WMF to be the only format they support :).
I suspect that PICT is too legacy a format, but with some luck there 
may be a way to export Quartz to PICT ... I'll give it a shot (being a 
Mac user only since OS X I didn't know of vector PICT ...).

Cheers,
Simon
#
A search for PDF to WMF gives me, among the others

http://www.business-presentations.co.uk/tranpro.htm

stefano
On Feb 10, 2005, at 7:11 PM, Denis Chabot wrote: