Code covered by the BSD License  

Highlights from

5.0 | 9 ratings Rate this file 28 Downloads (last 30 days) File Size: 5.59 KB File ID: #6854 Version: 1.2
image thumbnail



Aslak Grinsted (view profile)


03 Feb 2005 (Updated )

Easy way of saving figures to publication friendly format.

| Watch this File

File Information

  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])

MATLAB release MATLAB 7 (R14)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (10)
14 Aug 2015 Roule

Roule (view profile)

hey Aslak, really nice function.

i am able to save it to 600 dpi and all, but in the saved .tif file, the legend box is becoming excessively big with lot of extra whitespace..

apart from this legend thing, everything else works fine..but i need the legend too...

any suggestions...

Comment only
26 Mar 2015 Marit

Marit (view profile)

03 Oct 2013 Bartek Luks  
17 Jun 2013 Tieyuan

Very nice tool!

Could I save figure in color using saveFigure?


28 Sep 2011 Khalil

Khalil (view profile)

09 May 2011 Xianmin

Saved lots of my time. Thanks!

13 Oct 2008 Hom Gharti

Very very important.

13 Apr 2007 Nickitas Georgas

Very useful to someone that wants to save a clean image quickly. I would suggest making the above usage part of the README file.

09 Jan 2007 Thomas Thurnheer

Thanks a lot, you saved my day!

01 Jun 2005 john moore

extreemly useful, AGU should make it known to everyone who uses Matlab for their articles

09 Feb 2005

Included a version of the routine that works in older versions of matlab.

+fixed a minor bug related to outputs.

09 Feb 2005

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

18 Mar 2014 1.1

Added handling of legends and colorbars.

09 Jul 2014 1.2

Fixes for R2014b

Contact us