A recent conversation on Twitter reminded me of a powerful way to edit graphs created in R inside PowerPoint:

I realise that R is incredibly powerful anyway, and that much of this can be done within R, but I am also painfully well aware that R is hard, and that many users prefer “point-and-click”.

This example uses Windows.

1. In R, let’s create a graph:

plot(iris$Sepal.Length, iris$Sepal.Width, main="My Graph", xlab="Width", ylab="Length")

2. You should see something like the graph below.  In the top left hand corner, choose File -> Save As -> Metafile, and save it somewhere convenient

mygraph3. Now, fire up PowerPoint and start with a blank slide.  Choose insert picture

insertpictureNavigate to the .emf file you just saved and choose it.  You should see:

inserted4. Now, right click the image, choose group -> ungroup:

ungroupYou will get a message asking if you want to convert the image to a Microsoft Drawing object.  Choose yes:


5. Now repeat step 4. Right click the image, choose group -> ungroup:

ungroupYou should now see something like this:

editableEvery single part of the graph is now selectable, moveable and editable!  Click outside of the chart area to de-select everything, and then click on individual components to edit them.  In the graph below I have changed the title, and given one of the data points a red background:



(I realise there are other ways to do this, perhaps better ways e.g. export as PDF then edit in Illustrator (thanks !  This post is really aimed at those familiar and comfortable with PowerPoint :-))