fn_savefig

Contents

Syntax

fn_savig([hobj][,fname][,options...])
im = fn_savig([hobj][,options...])

Description

Save an image of one or several figure(s). Large number of options
are available.
If function is called with no argument, or only with hf, an interface is
displayed that lets user choose the saving options.
If an output is requested, this forces 'capture' method and no file is
saved.
Input:
- hobj        vector of figure handles [default: current figure], or axes
              handle ('capture' method only)
- fname       char array or cell array - file name(s) [default: prompt
              user]
              if 'show', show captured image in new figure instead (of
              saving); if 'clipboard', copies to clipboard instead
- 'askname' or 'autoname'     prompt or do not prompt user for figure
              name, but build an automatic name, inside folder
              fn_cd('capture') [default]
- format      'png', 'bmp', 'jpg', 'svg', 'eps', 'ps' or 'fig', or a cell
              array with several formats [default: inferred from file
              name, or 'png' if file name has no extension]
- 'capture' or 'savefig'  capture method: 'capture' [default unless a
              vector format is requested] uses Matlab function
              getframe to capture an image which is saved to a file
              (i.e. the image will be strictly identical to what is seen
              on screen); 'savefig' uses Matlab function saveas to save
              (i.e. display will be changed according to some figure
              properties such as 'PaperPosition', see also parameter
              'scaling' below)
- 'subframe'  user select a sub-part of the figure to save ('capture'
              method only)
- rectangle   a 4-element vector defining the sub-part of the figure to
              save ('capture' method only)
- 'content'   cut image to remove white sides ('capture' method only)
- scaling     a scalar that defines by how much to scale the figure
              compared to screen display ('savefig' method only)
- 'append', 'append+pdf' or 'ps2pdf'  append to file (ps file only) and
              make pdf if specified ('ps2pdf' does not save the figure,
              but only convert existing ps file to pdf)
See also: fn_saveimg

Source

Thomas Deneux

Copyright 2003-2017