Home > GLMdenoise > utilities > getfigurepos.m

getfigurepos

PURPOSE ^

function f = getfigurepos(fig,units)

SYNOPSIS ^

function f = getfigurepos(fig,units)

DESCRIPTION ^

 function f = getfigurepos(fig,units)

 <fig> (optional) is the figure handle.  default: gcf.
 <units> (optional) is 'normalized' (default) | 'points'

 return the position of <fig> in units specified by <units>.

 example:
 figure; getfigurepos(gcf,'points')

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function f = getfigurepos(fig,units)
0002 
0003 % function f = getfigurepos(fig,units)
0004 %
0005 % <fig> (optional) is the figure handle.  default: gcf.
0006 % <units> (optional) is 'normalized' (default) | 'points'
0007 %
0008 % return the position of <fig> in units specified by <units>.
0009 %
0010 % example:
0011 % figure; getfigurepos(gcf,'points')
0012 
0013 % input
0014 if ~exist('fig','var') || isempty(fig)
0015   fig = gcf;
0016 end
0017 if ~exist('units','var') || isempty(units)
0018   units = 'normalized';
0019 end
0020 
0021 % do it
0022   prev = get(fig,'Units');
0023   set(fig,'Units',units);
0024 f = get(fig,'Position');
0025   set(fig,'Units',prev);

Generated on Fri 01-Aug-2014 12:03:17 by m2html © 2005