/[MITgcm]/MITgcm_contrib/eh3/llc/ecco-godae/climatology/plot_faces.m
ViewVC logotype

Annotation of /MITgcm_contrib/eh3/llc/ecco-godae/climatology/plot_faces.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Wed Mar 28 19:18:53 2007 UTC (18 years, 4 months ago) by jmc
Branch: MAIN
a simple routine to plot a face-structured array (and addapted for this
 polar-cap grid).

1 jmc 1.1 function plot_faces(ng,vF,k,ccB);
2     % plot_faces(ng,vF,k [,ccB]);
3     %
4     % make 1 figure (fig. number = ng) composed of Nface parts
5     % corresponding to level k (enter k=0 if 2D field) of the structured
6     % array "vF": vF.f001 = face 1, vF.f002 = face 2 ...
7     % with color range ccB(1),ccB(2) (default = ccB=[0 0] = no call to caxis)
8    
9     if nargin < 4, ccB=[0 0]; end
10    
11     %- extract list of faces:
12     % convention: faces identificator is "f{n}" (face number n written with 3 digits)
13     listV=fieldnames(vF); listF=[];
14     for i=1:size(listV,1)
15     cvar=char(listV(i));
16     if length(cvar) == 4 & strncmpi('f00',cvar,3),
17     if isempty(listF), listF=cvar; else listF=char(listF,cvar); end
18     end
19     end
20     listF=cellstr(listF);
21     Nfaces=size(listF,1);
22     if Nfaces > 6,
23     error([' Nb of faces =',int2str(Nfaces),' > 6 !'])
24     end
25    
26     xyP=zeros(6,4);
27     xyP(1,:)=[0.05 0.05 0.20 0.72];
28     xyP(2,:)=[0.29 0.05 0.20 0.72];
29     xyP(3,:)=[0.29 0.80 0.20 0.18];
30     xyP(4,:)=[0.53 0.05 0.20 0.72];
31     xyP(5,:)=[0.77 0.05 0.20 0.72];
32     xyP(6,:)=[0.77 0.80 0.20 0.18];
33    
34     xyP(3,:)=[0.05 0.80 0.20 0.18]; %- move face 3 in top-left corner
35     figure(ng);clf;
36     for n=1:Nfaces,
37     cvar=char(listF(n)); var=vF.(cvar);
38     if k ~= 0, var=var(:,:,k); end
39     if n > 3, var=fliplr(var'); end %- rotate face 4,5,6
40     if n == 3, var=flipud(var'); end %- rotate to put face 3 in top-left corner
41     AA=axes('position',xyP(n,:));
42     imagesc(var'); set(gca,'YDir','normal');
43     if ccB(1) < ccB(2), caxis(ccB); end
44     end
45     H=colorbar('peer',AA,'North');
46     set(H,'Position',[xyP(4,1) 0.90 xyP(4,3) 0.020]);
47    
48     return

  ViewVC Help
Powered by ViewVC 1.1.22