saveAllFigs(varargi​n)

Saves all open figures to timestamped folder with desired format and optional cropping.

You are now following this Submission

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 (2026). saveAllFigs(varargin) (https://www.mathworks.com/matlabcentral/fileexchange/52303-saveallfigs-varargin), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Printing and Saving in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0

Typo correction!