Code covered by the BSD License  

Highlights from
subplotPPT

5.0

5.0 | 4 ratings Rate this file 12 Downloads (last 30 days) File Size: 10.72 KB File ID: #20949
image thumbnail

subplotPPT

by Mark Hoyle

 

01 Aug 2008 (Updated 24 Aug 2009)

Saves multiple MATLAB figure windows to powerpoint giving the user "subplot" style control over thei

| Watch this File

File Information
Description

Saves multiple MATLAB figure windows to powerpoint giving the user "subplot" style control over their positions in the final slide.

Given multiple figures you can use commands like:

subplotPPT(m,n,k,...) to print a copy of the figure to a powerpoint slide. The first three arguements behave like those of subplot: m rows of images, n columns amd k gives you the index of the image to paste to (if k has two element per image then the function will merge the image across the locations). Other inputs:

Vector of handles to figures to paste into the slide

Filename of powerpoint file to use

slide number to print to

Region of the slide to print to

image file format to print to (e.g jpg, png, bmp ...)

gaps between adjacent images

units for specifying measures in.

The zip file contains subplotPPT and test_PPTScript which runs through some examples of how to call the function

Example:

The code:

h(1) = figure;
peaks;
h(2) = figure;
membrane;
h(3) = figure;
spy;
h(4) = figure;
image;
h(5) = figure;
tori4;

subplotPPT(3,3,...
[1 4; 2 3; 5 5; 6 9; 7 8],...
h,[pwd,filesep,'test.ppt'],4,...
'region',[200 100 500 340],...
'hgap',10,'vgap',10,'units','pixels');

Generates the screenshot

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
saveppt

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
01 Aug 2008 Carlos Adrian Vargas Aguilera

It works fine Mark! Is there any way to get the output in an image file (PNG for example) rather than in PPT?

Regards, Carlos

06 Aug 2008 Thierry Dalon

Good idea and implementation.

15 Sep 2008 Stan Young

Tried on version 6.5 on Windows
After correcting the mkdir (for windows) The test script hung up around line 152 in subplotPPT when it was testing the existence of FileData.FileName. FileData was declared [] earlier and never initialized to anything else. Where am I going wrong?

09 Oct 2009 Anne-marie Carriero

How do I get the slide number to continue in the for loop.
For instance, I have 100 figures to put into my .ppt.
I have it set up for 2 figures on one slide starting on slide 8 of my .ppt template. How do I get figures 3 and 4 to be put on slide 9?
Thanks!

05 Jan 2010 Glenn

Very quick and useful. Now if I can only get my colleagues to adopt this as well.

Please login to add a comment or rating.
Updates
06 Aug 2008

Fixing a bug in the previous code and adding the capability to save as an image file. Powerpoint allows you to save slides to a range of image file type. subplotPPT now lets you save the resulting slide to an image file. See test script for examples.

06 Jan 2009

Now contains a file "subplotPPT_2007" for use with Office 2007. Thanks to Mykel Kochenderfer for pointing this out to me.

24 Aug 2009

Added in copyright information

24 Aug 2009

Included Trademark Information

Tag Activity for this File
Tag Applied By Date/Time
graphics import Mark Hoyle 22 Oct 2008 10:12:57
graphics export Mark Hoyle 22 Oct 2008 10:12:57
powerpoint Mark Hoyle 22 Oct 2008 10:12:57
activex Mark Hoyle 22 Oct 2008 10:12:57
subplot Mark Hoyle 22 Oct 2008 10:12:57
export Mark Hoyle 22 Oct 2008 10:12:57
graphics Mark Hoyle 22 Oct 2008 10:12:57
import Mark Hoyle 22 Oct 2008 10:12:57
utilities Mark Hoyle 22 Oct 2008 10:12:57
powerpoint Jennifer 29 Oct 2010 14:07:19

Contact us at files@mathworks.com