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

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

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

Initial import of Stark code.

Line 
1 function [smin,smax,ibw]=colorband_fd_xy(x,y,scalar,smin,smax,ibw)
2 fprintf(1,'Scalar Range: %f to %f\n',min(min(scalar)),max(max(scalar)))
3 %
4 if nargin == 3
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(64);
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(x,y,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 hl=clabel(c,h);
30 %
31 size(scalar);
32 axis([min(min(x)) max(max(x)) min(min(y)) max(max(y))]);
33 % set(gca,'XTick',[]);
34 % set(gca,'YTick',[]);
35 drawnow;
36 clear cmap;
Note: See TracBrowser for help on using the browser.