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

root/gliderproc/trunk/MATLAB/opnml/FCAST_1.2/matlab_cen/colorbandi_fe.m

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

Initial import of Stark code.

Line 
1 %-----------------------------------------------------------------------
2 % [smina,smaxa,ibw]=colorband_fe(in,x,y,bnd,scalar,smina,smaxa,ibw)
3 % This function creates a color banded plot using
4 % Matlab5.1 commands and the jet color map.
5 %-----------------------------------------------------------------------
6 function [smina,smaxa,ibw]=colorband_fe(in,x,y,bnd,scalar,smina,smaxa,ibw)
7 %
8 % Echo scalar range to screen
9 %
10 fprintf(1,'Scalar Range: %f to %f\n',min(min(scalar)),max(max(scalar)))
11 %
12 % Set color banding settings (if 5 arguments are sent to function)
13 %
14 if nargin == 5
15    smina=input('Enter min contour level desired: ');
16    smaxa=input('Enter max contour level desired: ');
17    ibw  =input('Enter the contour interval:      ');
18 end
19 cvala=smina:ibw:smaxa;
20 nband=(2*ibw+smaxa-smina)/ibw;
21 cmapjet=jet;
22 size(cmapjet);
23 njet=ans(1);
24 clear cmap;
25 for i=1:nband
26    cmap(i,:)=cmapjet(1+round((njet-1)*i/(nband+1)),:);
27 end
28 for i=1:nband
29    cmap1(i,:)=cmap(nband+1-i,:);
30 end
31 cmap=cmap1;
32 %
33 % Generate plot
34 %
35 scalara=max(scalar,smina-ibw);
36 scalara=min(scalar,smaxa+ibw);
37 hpb=plotbnd(x,y,bnd);set(hpb,'color','k');
38 hl=lcontour2(in,x,y,scalara,cvala);
39 hc=colormeshm(in,x,y,scalara);colormap(cmap);caxis([smina-ibw smaxa+ibw]);
40 hb=colorbar;set(hb,'ytick',cvala);set(hb,'ticklength',[0.05 0.025]);
41 % set(hb,'FontSize',1.0);
42 for l=1:nband-1
43    if cvala(l)>=min(scalara) & cvala(l)<=max(scalara)
44       set(hl(l),'color','k');
45    end
46 end
Note: See TracBrowser for help on using the browser.