saveAllFigs(varargi​n)

Saves all open figures to timestamped folder with desired format and optional cropping.
116 Downloads
Updated 27 Jul 2015

View License

When I have many figures open, I often want to just save them all to one place quickly, without having to deal with each individually or handle creating a separate location. Available formats are .fig, .eps, .jpg, .png and .emf, but additional options can be added very easily.
Figures are saved as the title of the plot, if this exists - duplicate titles are numbered - or just by a generic numbered figure otherwise.
The first line of code also crops whitespace from the figure - setting tight to false does not crop.

saveAllFigs() - saves all open figures as .fig in a folder in the current working directory.

saveAllFigs(extension) - saves all open figures with the given extension, in a folder in the current working directory.

saveAllFigs(extension, path) - saves all open figures with the given extension, in a folder in the directory with the given path from the working directory.

Cite As

Danielle Saunders (2024). saveAllFigs(varargin) (https://www.mathworks.com/matlabcentral/fileexchange/52303-saveallfigs-varargin), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Printing and Saving in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0

Typo correction!