source: MML/trunk/applications/common/xaxesposition.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 867 bytes
Line 
1function xaxesposition(PercentChange)
2%  X-axes scaling for all the axes in a figure
3%
4%  INPUTS
5%  1. PercentChange - Percentage for scaling (1 means no change)
6%
7%  See also yaxesposition
8
9
10%
11%  Written by Gregory J. Portmann
12
13
14h = get(gcf,'children');
15
16% set(gcf, 'Units', get(0, 'Units'));
17% Pfig = get(gcf, 'Position');
18% set(gcf, 'Position', get(0, 'ScreenSize'));
19   
20for i = 1:length(h)
21    hget = get(h(i));
22    if isfield(hget, 'Position') & ~strcmpi(hget.Tag, 'Legend')
23        p = get(h(i), 'Position');
24        if PercentChange > 1
25            Percent = PercentChange - 1;
26            set(h(i), 'Position', [p(1)-p(3)*Percent/2 p(2) p(3)+p(3)*Percent p(4)]);
27        else
28            Percent = 1 - PercentChange;
29            set(h(i), 'Position', [p(1)+p(3)*Percent/2 p(2) p(3)-p(3)*Percent p(4)]);
30        end
31    end
32end
33
34%set(gcf,'Position', Pfig);
Note: See TracBrowser for help on using the repository browser.