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

root/gliderproc/trunk/MATLAB/plots/labelab1.m

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

Initial import of Stark code.

Line 
1 function labelab1(asc,loc,ftsz)
2 %% function labelab1(asc,loc,ftsz)
3 %
4 %%asc: the ascii string for labeling plotting panel
5 %%loc: location code, default (1) is at upper right, (-1) if x-axis is reversed
6 %%     (2) Lower right; (-2) if y-axis reverse, others  Center up (title position)
7 %%ftsz: font size
8 %% use negative(loc) for reversed x-axis plots
9
10 if(nargin<3); ftsz=14; end %use default
11 if(nargin<1); asc=' '; end
12 if(nargin<2); loc=1; end
13
14 ax=axis; zoff=0.02*(ax(4)-ax(3)); xoff=0.02*(ax(2)-ax(1)); %*sign(loc);
15 axis(ax); %make sure axis does not change when printing
16 %loc=abs(loc);
17 if(loc==1);
18  text(ax(2)+xoff,ax(4)-3*zoff,asc,'FontSize',ftsz); %produce a label at upper right corner of plot
19 elseif(loc==-1); %xaxis reverse
20  text(ax(1)-xoff,ax(4)-2*zoff,asc,'FontSize',ftsz);
21 elseif(loc==-2); %yaxis reverse
22  text(ax(2),ax(3),asc,'FontSize',ftsz);
23 elseif(loc==2);
24  text(ax(2)+xoff,ax(3)+zoff,asc,'FontSize',ftsz);
25 else
26  text((ax(1)+ax(2))/2,ax(3),asc,'FontSize',ftsz)
27 end
28 %if(ftsz>0);
Note: See TracBrowser for help on using the browser.