23/03/2012

Matlab figures in Powerpoint

I've just been putting together a presentation in which I wanted to include a set of Matlab plots. Whilst there are plenty of ways to do this I thought I would detail the way I managed it...

I've mentioned before about maintaining quality by using vector graphics. Previously I've used .eps format for this, but I don't think it's well supported in Powerpoint (I did consider using alternative presentation software but I was pressed for time and this seemed like the easiest option). Instead I used .emf format which seems pretty well supported by Matlab. This is a Windows specific format so I can't say I'm particularly keen on it for general use, but it served a purpose here.

I saved my figures as separate images from Matlab and then imported into Powerpoint, but I think the same result can be achieved if you simply copy and paste between the two.

One of the benefits of having the plots in vector format is the ability to manipulate them within Powerpoint itself. For the unscrupulous this could be a good technique for "adjusting" a few points here and there to improve  your results - but obviously I didn't do that! What I did do was separate out several lines that were on the same plot, so that I could make them appear (using Powerpoint's animation features) gradually. This made the plots (which were a comparison of the results of several different simulations) much cleaner.

It was a little bit of a hassle to do this, but not awful, and I think worthwhile as it made the results much easier to present. When the .emf file is initially imported it is handled as an image; however, if you right click on it you will find that it can be "ungrouped". You might have to repeat this process a few times as the image seems to be built up of several sub-groups, but once you're done you'll find that individual lines are available to be manipulated. Unfortunately I then had to go through and "regroup" some of them manually to reform complete lines, which involved a bit of 'Ctrl' clicking - this was the tedious bit. I guess it depends how complicated the lines in your plots are as to how long this will take (and whether it is worthwhile or not).

Another benefit was being able to alter the font of my axes to match my presentation style. A trivial point perhaps, but it all goes to improve the overall appearance.

So to summarise:

  1. Copy figure in Matlab
  2. Paste in Powerpoint
  3. Right click and "ungroup"
  4. Repeat 3. until you get to a  level that you can manipulate the objects that you want
  5. You may find there are a few large white squares that form the background of the plot - these can be deleted (it will make things easier when you come to regrouping things in step 7.)
  6. 'ctrl'+'a' to select everything and then change the font to match your presentation
  7. 'ctrl' and click on objects to collect all the ones that should be in a group (you may need to zoom in on your slides to do this accurately)
  8. right click and "group" them
  9. move/recolour/animate/resize the objects as you desire to suit your presentation!

Hope that is of help to someone!?

6 comments:

  1. Thanks for these useful tips.

    ReplyDelete
  2. It does not work on my machine, nothing happens after clicking 'ungroup' the figure still remains as an image.

    ReplyDelete
    Replies
    1. I can't guarantee that this works on all versions and on all machines, but if ungroup is there as an option I would be surprised if it didn't do anything?

      Delete
    2. Working on mac os I could not find .emf format, then I had to save with .svg format, then insert file in power point, right click, convert into form, ungroup

      Delete
    3. EMF is quite a windowsy format, so I'm not surprised if it's not there on mac. SVG is probably a better and more modern option if it's available.

      Delete
  3. I am preparing my defence presentation. This tool you are sharing is excellent. Editable figures in PowerPoint is convenient. Thanks a lot.

    ReplyDelete