NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/plots/prstuff/ChangeView.m

Revision 495 (checked in by cbc, 12 years ago)

Initial import of Stark code.

Line 
1 function ChangeView(command)
2 % function ChangeView(command)
3 %
4 % Abstract:
5 %    reduce or enlarge view of the figure window by 10%.
6 %
7 % Usage:
8 %    >> ChangeView([command])
9 %       where command = 'reduce' (default) or 'enlarge'
10
11 global LASTFIGURE
12 if isempty(LASTFIGURE)
13   curfig=gcf;
14 else
15   curfig=LASTFIGURE;
16 end
17
18 if nargin < 1
19   command = 'reduce';
20 end
21
22 pos = get(curfig,'position');
23 top = pos(2)+pos(4);
24
25 if strcmp(command, 'reduce')
26   newW = pos(3) - pos(3)*0.10;
27   newH = pos(4) - pos(4)*0.10;
28   newpos = [pos(1) top-newH newW newH];
29 else
30   newW = pos(3) + pos(3)*0.10;
31   newH = pos(4) + pos(4)*0.10;
32   newpos = [pos(1) top-newH newW newH];
33 end
34
35 set(curfig,'position',newpos);
Note: See TracBrowser for help on using the browser.