View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Save Multiple Figures in a click

4.7 | 37 ratings Rate this file 77 Downloads (last 30 days) File Size: 64 KB File ID: #35082 Version: 1.10
image thumbnail

Save Multiple Figures in a click


Nicolas Beuchat (view profile)


14 Feb 2012 (Updated )

Save multiple figures with a GUI in several formats. No need to save all figures one-by-one anymore!

| Watch this File

File Information

savemultfigs allows one to save all opened figures using a nice user interface and in several formats in one time. No need to save all figures one-by-one anymore!

The following features are available:
- Select which figures to save in a click
- Name each figure independently based on the figure name if specified (credits go to Tassos for this feature)
- Save the same figures in several formats at once
- Save in 14 different formats (fig, jpg, eps, tif, etc.)
- Create a subdirectory for each format

This tool is particularly suited if you have a large number of figures to export at once and/or if you often save the same figure in several formats (fig, tif and eps for example).

Required Products MATLAB
MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (53)
13 Aug 2016 Amin Khalaf

Very helpful, it is works for newer versions but with small modifications mentioned by Leon (see blew)

20 Jul 2016 Manolis Trypakis

Great tool, I have used it in the past. Does not work for newer versions of Matlab though which is a pity.

Comment only
20 Jul 2016 Manolis Trypakis

11 May 2016 Hwang

Hwang (view profile)

It is cool! But it cannot handle figures not using the default size. If I want my fig 800*600, savemultfigs cannot save the figure as a .png or .emf file with this size, while .fig may work well.

17 Mar 2016 Alexander Ortiz

Great tool! Doesn't work for R2015a/b though, it will great to get it fix :)

28 Jan 2016 Stevan Jeknic

Doesn't work in 2015b.

Comment only
26 Nov 2015 Tom0610


Is it possible to change the resolution at which the figure is saved at .jpg or .png?

Furthermore, how do I save it as .pdf in landscape?


Comment only
29 Oct 2015 J

J (view profile)

Didn't work for subplots and for more than 25ish plot the scroll bar isn't helpful, it jumps in decimal values! Shame!

26 Aug 2015 Md. Golam Mostafa

It was extremely helpful for me.

12 Mar 2015 Quenton

Dominik - I just downloaded 2015a and Leon's suggestion works for me. If you tell me how to upload the modified file, I can.

24 Feb 2015 Dominik Ginnheim

2014b. I did implement Leon's suggestions, however it is still not running. It is getting incredibly slow and crashes very often. Does anyone share the same experience? Did you find a solution to this?

12 Feb 2015 sairamesh nammi

Thank you so much for the file. This is what I am looking for.

10 Feb 2015 Faizan Rehmatullah

When I change the size of my figure, the PDF and EPS files do not scale properly. Any suggestion on fixing this problem?

27 Jan 2015 Abhinav Garg

For saving eps figures in colored format instead of black and white, one way is to add the following line after line no. 315 in the code.

filetype = strrep(filetype,'eps', 'epsc');

22 Jan 2015 Vivek

Vivek (view profile)

Good, but when the figure is named with a text that has a file extension, it doesn't work. For example, if I plot a figure and name the title say "data.log" using the command
And after that if I open the savemultfigs GUI, it picks up the figure but also throws an error
Error using savefig (line 41)
Argument must be a .fig file
I think this is because it sends the actual name of the figure as an argument and then doesn't know what to do with it if an extension is there in the name.

11 Dec 2014 Leon

Leon (view profile)

Really useful tool, thanks!

t3925, Raffaello:
The problem is related to new graphic handles in r2014b. You just need to replace every expressions:

"num2str(figlist(i))" with "num2str(figlist(i).Number)"


"num2str(handles.figlist(i))" with "num2str(handles.figlist(i).Number)"

10 Dec 2014 t3925

t3925 (view profile)


Thank you for creating this tool. I've been using it extensively and it is a huge time saver. Unfortunately it no longer works as of R2014b due to the same error below highlighted by Raffaello.

It's been so useful that I'm seriously considering sticking for R2014a for this tool alone!

01 Dec 2014 kammo

kammo (view profile)

This script would be very useful for me, but it does not run on Unix R2014b. The output I get when I launch the script is:

>> clear all
>> figure
>> figure
>> savemultfigs
Undefined function 'abs' for input arguments of type 'matlab.ui.Figure'.

Error in num2str (line 66)
xmax = double(max(abs(widthCopy(:))));

Error in savemultfigs>savemultfigs_OpeningFcn (line 90)
defaultfilenames{i} = [defaultfilename num2str(figlist(i))];

Error in gui_mainfcn (line 220)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});

Error in savemultfigs (line 39)
gui_mainfcn(gui_State, varargin{:});

Comment only
26 Aug 2014 Roland

Roland (view profile)

23 Jun 2014 Allen

Allen (view profile)

Great gui! It appears eps is saved in black and white? Is there a way to change that? Thanks!!

10 Jun 2014 Igor

Igor (view profile)

Awesome tool!
A bug: figure names with comma create one file with no extension and stop the saving process for all further files (same file with different extension of other files).


Comment only
29 May 2014 Andre

Andre (view profile)

Works perfectly.

29 Jan 2014 Bryan

Bryan (view profile)

This is a great tool. One suggestion: if you change the eps box to epsc then it will save as a color image.

07 Nov 2013 Soner Ulun

27 Sep 2013 ahmed

ahmed (view profile)

perfct tool

27 Aug 2013 Sofie

Sofie (view profile)

21 Aug 2013 Leonardo Jose Trejo

Very nice little tool. Thanks! Two comments: first, when saving files of a given type, e.g. ".fig," the function didn't append the extension to the file names, so Windows Explorer didn't know how to open the files later. It would be nice to auto-append this. Also, on a Mac, I could not paste a string of characters into the field for folder name or the fields for file names. I wanted to use as the base for the file name and had to type in a long string into each field. This worked in Windows, however.

07 Aug 2013 Justin

Justin (view profile)

25 Jul 2013 Tom

Tom (view profile)

so,so good. thank you for taking the time to create this.

17 Jul 2013 Manolis Trypakis

You saved me a huge amount of time. Very helpful, efficient and flexible. Thank u Nocolas!

09 Feb 2013 Rajib Mozumder

Excellent GUI! For some reason, when I save files as .eps, they are saved as black and white and .emf doesn't work! Other than that, all the other formats are working fine.

10 Dec 2012 Nicolas Beuchat

Nicolas Beuchat (view profile)

Hi Lucas,

I imagine that you are referring to the default file name feature? The program take as default filename the figure name (not the title). You can change the figure name by doing:



Comment only
10 Dec 2012 Lucas

Lucas (view profile)

When I download the file, I seem to be getting an older version rather than the march 2012 update

25 Oct 2012 Jessica ?

Yes, it's called two times. Thank you very much! The function is really useful for me !

24 Oct 2012 Nicolas Beuchat

Nicolas Beuchat (view profile)

Hi Jessica!

Did you call savemultfigs a second time? Or do you have this error systematically? There is a bug I haven't solved yet that gives this error when savemultfigs is called a second time while the other savemultfigs is still open.

If that's the case, the solution for now is simply to close the gui and relaunch savemultfigs.

Thanks for the comments! I will try to solve this bug and incorporate other useful comments.


Comment only
24 Oct 2012 Jessica ?

Hi, when I run the code, a problem comes out'Conversion to logical from cell is not possible.

Error in savemultfigs>pushbuttonSave_Callback (line 341)
if dosave

Error in gui_mainfcn (line 96)

Error in savemultfigs (line 39)
gui_mainfcn(gui_State, varargin{:});

Error in

Error while evaluating uicontrol Callback'

Could anyone help me?
Thanks a million.

Comment only
15 Oct 2012 b3824855

This is great! Thank you very much for creating this! Saved me so much time! :)

07 Sep 2012 Alan

Alan (view profile)

What I find Odd is the inconsistency in this program saving, vice using save in the toolbar.
For instance, I have my figures set up with the PaperOrientation to Landscape. When I save as PDF from the toolbar, MATLAB still saves it in Portrait format. Your program is actually better for PDF as it saves it in Landscape.
However, the opposite is true for PNG files. Saving from the Toolbar gives me landscape, your program gave me rotated landscape. (Easy enough to fix with a graphics editor though)

Don't get me wrong, great tool! Will save me a lot of time, regardless.

21 Aug 2012 Abhinav Garg

Very helpful. But I have issues when saving the figures as .eps as it saves them as black & white image. Please clarify.

Comment only
21 Aug 2012 Abhinav Garg

Very helpful. But I have issues when saving the figures as .eps as it saves them as black & white image. Please clarify.

13 Apr 2012 Matteo Niccoli

Very much needed

08 Apr 2012 Scott Otterson

Handy! One suggestion: if the output directory doesn't exist, offer to make it. I expected this because it already makes directories for the different file types.

05 Apr 2012 Jeff

Jeff (view profile)

Great submission. I would suggest adding an option for anti-aliasing (see Myaa - My Anti-Alias for Matlab). Also great would be the ability to use TeX to render the text. Finally it would be great if you could merge all the results into a single PDF.

24 Mar 2012 DimoneTHEone

09 Mar 2012 Tassos

Tassos (view profile)

Yeap, changes should definitely be kept in the same file :) So, please go ahead and update the file here too.

Comment only
08 Mar 2012 Nicolas Beuchat

Nicolas Beuchat (view profile)

Thank you for the suggestion! It is a very good idea!

I implemented your modification with a slight change in the code (you actually don't need to convert from mat2cell and cell2mat by using defaultfilenames{i}).

If you don't mind, I'd rather update this file so that everything is kept at one place! I will obviously mention you.

Thanks again!

Comment only
08 Mar 2012 Tassos

Tassos (view profile)

Very useful app! However, I thought that it would be more useful if it was detecting the 'Name' given to each figure and automatically use it as default filename for the saving.

So I did the following modification, by changing the definition of 'defaultfilename' from a simple 'filename' like this:

for i=1:length(figlist)
if isempty(get(figlist(i),'Name'))
defaultfilenames(i) = mat2cell(['filename' num2str(i)]);

Then, all you have to do is use 'defaultfilenames' for the field that displays the default filename, and also convert the string from cell to mat, just before actual saving the file (because fullfile function cannot handle cell elements).

I can post the modified file if you are interested.


Comment only
28 Feb 2012 Nicolas Beuchat

Nicolas Beuchat (view profile)

The bug is now corrected, my apologies for the delay!

Comment only
27 Feb 2012 Nicolas Beuchat

Nicolas Beuchat (view profile)

Apparently the last submission was not correct too. While waiting for the corrected version, you can change the problematic lines which are lines 360 and 362 as:


should be replaced by


My apologies for these issues.

Comment only
25 Feb 2012 Nicolas Beuchat

Nicolas Beuchat (view profile)

Actually, the last version (2/24/12) has another huge bug which make all the figures to be saved as the last figure... Please, wait for the new submission to be approved!

Comment only
25 Feb 2012 Nicolas Beuchat

Nicolas Beuchat (view profile)

The last version (2/24/12) included a little bug. An error appear in the command prompt after successful saving. This bug does not affect the saving and a correction has just been submitted!
Sorry about that!

Comment only
21 Feb 2012 John

John (view profile)

Very helpful, thank you Nicolas!

21 Feb 2012 Virginie

21 Feb 2012 1.3

Correction of the display of the number of files saved.

24 Feb 2012 1.4

Check for figures having the same filename and rename them before saving.

25 Feb 2012 1.5

Correction of a little bug that came out with the last version (24 Feb 2012) which displayed an error message after successful saving.

25 Feb 2012 1.6

Correction of another bug introduced in the 2/24/12 version (all files were saved as the last figure).

27 Feb 2012 1.7

Correction of the same bug that make the app to save all the figures as the last figure.

08 Mar 2012 1.10

Default filename is now the name of the figure (if specified). Credits go to Tassos for this update.

Contact us