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

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

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

Initial import of Stark code.

Line 
1 function [smin,smax,ibw]=colorband_fd(scalar,smin,smax,ibw)
2 fprintf(1,'Scalar Range: %f to %f\n',min(min(scalar)),max(max(scalar)))
3 %
4 if nargin == 1
5    smin=input('Enter min contour level desired:  ');
6    smax=input('Enter max contour level desired:  ');
7    ibw  =input('Enter the contour interval:      ');
8 end
9 %
10 cval=smin:ibw:smax;
11 nband=(2*ibw+smax-smin)/ibw;
12 cmapjet=jet;
13 size(cmapjet);
14 njet=ans(1);
15 clear cmap;
16 cmap(1,:)=[0 0 0];
17 for i=2:nband-1
18    cmap(i,:)=cmapjet(1+round((njet-1)*(i-2)/(nband-3)),:);
19 end
20 cmap(nband,:)=[1 1 1];
21 %
22 colormap(cmap);
23 caxis([smin-ibw smax+ibw]);
24 [c,h]=contourf(scalar,cval);
25 %
26 colormap(cmap);
27 caxis([smin-ibw smax+ibw]);
28 hb=colorbar;set(hb,'ytick',cval);set(hb,'ticklength',[0.05 0.025]);
29 set(hb,'FontSize',1.0);
30 hl=clabel(c,h);
31 %
32 size(scalar);
33 axis([1 ans(2) 1 ans(1)]);
34 set(gca,'XTick',[]);
35 set(gca,'YTick',[]);
36 drawnow;
37 clear cmap;
Note: See TracBrowser for help on using the browser.