Documentation of shade_solid2


Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)


Function Synopsis

H = shade_solid(aray, level, alt, colr);

Help text


  shade_solid(data, lev, alt, color)

  This function shades in areas where the matrix data is 
  greater than the value 'lev'.  Note that lev MUST be 
  a scalar, so this isn't like contourf.  This is all done
  for a map axis.

  The variable 'color' may be input as a 3 element numeric 
  vector [r g b], or left for default, [.7 .7 .7]


Cross-Reference Information

This function calls

Listing of function shade_solid2

function H = shade_solid(aray, level, alt, colr);

aray = squeeze(aray);

if nargin < 4; colr = 0.7; end;

if nargin < 3; alt = -1; end;

if isscalar(colr);
    if isstr(colr);
        error('colr must be numeric - [r g b]');
    else
        colr = colr*[1 1 1];
    end
end

if ~ismap(gca);
     error('This function works for map axes only.  Try greyshd for non-map axes.');
end


%  First, determine if hold is 'on', or 'off'.

next_ax = lower(get(gca, 'NextPlot'));
if strcmp(next_ax, 'replace'); 
  set(gca, 'NextPlot', 'add');
end;

global XAX YAX FRAME

if (size(YAX,1)==1); YAX = YAX'; end;
if (size(XAX,1)==1); XAX = XAX'; end;

[xk, yk] = keep_var(FRAME, XAX, YAX);

if (FRAME(2)-FRAME(1) == 360);
  aray2 = [aray(:,:) aray(:,1)];
  XAX2 = [XAX; (XAX(1)+360)];
  YAX2 = YAX(:);
else
  aray2 = aray(:,:);
  XAX2 = XAX(:);
  YAX2 = YAX(:);
end

clev = level*[1 1];

%  Plot the data

ver = version;
if strcmp(ver(1), '6');
  [c, h] = contourm(YAX2, XAX2, aray2, clev);
elseif strcmp(ver(1), '5');
  [c, h] = contorm(YAX2, XAX2, aray2, clev);
end;

%  Now, delete contour, and make a patch
delete(h);
[lattrm, lontrm] = maptrimp2(c(2,2:end), c(1,2:end), FRAME(3:4), FRAME(1:2));
hh = patchm(lattrm, lontrm, alt, 'k');
%hh = patchm(c(2,2:end), c(1,2:end), alt, 'k');
set(hh, 'edgecolor', colr, 'facecolor', colr);

if nargout == 1;
  H = hh;
end

set(gca, 'NextPlot', next_ax);