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.
Danielle Saunders (2023). saveAllFigs(varargin) (https://www.mathworks.com/matlabcentral/fileexchange/52303-saveallfigs-varargin), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!