% Function sat=wlplot(t,p,y) plots the "image" of matrix y obtained from
% the "wavelet" with color saturation above sat%.
%
% .......................................................................
% Reference: Zhou YH, Zheng DW, Liao XH, Wavelet analysis of 
%            interannual LOD, AAM and ENSO: 1997~98 El Niņo 
%            and 1998~99 La Niņa signals, Journal of Geodesy, Vol.75, 
%            Page 164-168, 2001.
% .......................................................................
%
function sat=wlplot(t,p,y)
a=min(min(y));% min=a;
b=max(max(y));% max=b;
sat=input('color saturation above what % = ');
if sat<100
   b=b*sat/100;a=a*sat/100;
   bb=find(y>b);aa=find(y<a);
   y(bb)=b*ones(length(bb),1);y(aa)=a*ones(length(aa),1);
   else
end
y=fix(63*(y-a)/(b-a)+1);
%h=input('figure handle = ');
%figure(h);
%axes('position',[0.2 0.34 0.4 0.4]);
%image(t,log2(p),y);
%colormap(wldat);
figure, colormap('jet'),image(t,log2(p),y);
%colorbar('vert');
%colorbar('horiz');