Easy way of saving figures to publication friendly format.


Updated 9 Jul 2014

View License

Easy way of saving figures to publication friendly format

Usage: [Args=]savefigure(name[,property,value,...])

properties and default value
'Size',[3.3 2.5] inches
'FontSize',0 fontsize multiplier
'MinFontSize',8 minimum fontsize in pt
'LineWidth',.5 linewidth multiplier
'MinLineWidth',.5 minimum linewidth in pt
'MarkerSize',.5 markersize multiplier
'MinMarkerSize',3 minimum MarkerSize in pt
'Margins',[0 0 0 0] [Left,Right,Top,Bottom] - can be used to set margins (relative units)
. * When using automargins then this will be interpreted as additional margins
. * when a single number is specified then it is used as a multiplier to the tight-inset used for auto margins.
'PrintOptions','' (OBSOLETE! Use Format or file-extension instead)
'Format','png' if not specified then it will be inferred from the filename

close all;
savefigure('test.png','s',[3.3 2.5])

Cite As

Aslak Grinsted (2023). savefigure (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Fixes for R2014b

Added handling of legends and colorbars.

I submitted an update earlier today, but a major bug sneaked into parseArgs.m ... This has been fixed in this version.