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