Home > applications > common > yaxesposition.m

yaxesposition

PURPOSE ^

YAXESPOSITION - Vertical axes scaling for all the axes in a figure

SYNOPSIS ^

function yaxesposition(PercentChange)

DESCRIPTION ^

YAXESPOSITION - Vertical axes scaling for all the axes in a figure
 
  INPUTS
  1. PercentChange - Percentage for scaling (1 means no change) 

  See also yaxesposition

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function yaxesposition(PercentChange)
0002 %YAXESPOSITION - Vertical axes scaling for all the axes in a figure
0003 %
0004 %  INPUTS
0005 %  1. PercentChange - Percentage for scaling (1 means no change)
0006 %
0007 %  See also yaxesposition
0008 
0009 
0010 %
0011 %  Written by Gregory J. Portmann
0012 
0013 
0014 h = get(gcf,'children');
0015 
0016 % set(gcf, 'Units', get(0, 'Units'));
0017 % Pfig = get(gcf, 'Position');
0018 % set(gcf, 'Position', get(0, 'ScreenSize'));
0019     
0020 
0021 for i = 1:length(h)
0022     hget = get(h(i));
0023     if isfield(hget, 'Position') & ~strcmpi(hget.Tag, 'Legend')
0024         p = get(h(i), 'Position');
0025         if PercentChange > 1
0026             Percent = PercentChange - 1;
0027             set(h(i), 'Position', [p(1) p(2)-p(4)*Percent/2 p(3) p(4)+p(4)*Percent]);
0028         else
0029             Percent = 1 - PercentChange;
0030             set(h(i), 'Position', [p(1) p(2)+p(4)*Percent/2 p(3) p(4)-p(4)*Percent]);
0031         end
0032     end
0033 end
0034 
0035 %set(gcf,'Position', Pfig);

Generated on Mon 21-May-2007 15:32:41 by m2html © 2003