Documentation of mcolor3


Global Index (short | long) | Local contents | Local Index (short | long)


Function Synopsis

mcont3(data, cint, mstyle, origin);

Help text


  mcont3(data, cint, mstyle, origin);

  This function uses the mapping toolbox to shade the
  input 'data' matrix.  It assumes that the x and y axes
  are defined in the global variables XAX and YAX, 
  respectively.

  Note that this function works for stereo projections, or
  (Try typing 'maps' to see the style of the projection 
  you want to use).  It may work for anything mcolor.m works
  for, but I haven't tested it.

  The default mstyle is North Polar Stereographic ('stereo'), 
  centered at the north pole, and 270 degrees.  This should
  all be pretty easy to change, though.


Cross-Reference Information

This function calls

Listing of function mcolor3

function mcont3(data, cint, mstyle, origin);

%  Dan Vimont, 2 September, 1999

data = squeeze(data);

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

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

%  Get the global varaibles XAX YAX and FRAME

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

[m, n] = size(data);
if or((m~=length(YAX)), (n~=length(XAX)));
  error('[length(YAX) length(XAX)] must equal size(data)');
end

%  Set defaults

if nargin < 2; cint = (max(max(data))-min(min(data)))/10; end;
if nargin < 3; mstyle = 'stereo'; end;
if nargin < 4; origin = [90 270]; end;
lab = 0;
line_style = 'k';

%  Define contour interval;

if isscalar(cint);
  clev = sort([-cint:-cint:min(min(data)) 0 cint:cint:max(max(data))]);
else
  clev = cint;
end

%  Redefine XAX, YAX and data for global contouring -- allowing 
%  for wrapping around the globe.

[xk, yk] = keep_var(FRAME, XAX, YAX);
if (FRAME(2) - FRAME(1) == 360);
  data2 = [data(yk,:) data(yk,1)];
  XAX2 = [XAX; XAX(1)+360];
else
  data2 = data(yk, xk);
  XAX2 = XAX(xk);
end;
YAX2 = YAX(yk);

%  Define map axis:

axesm('mapprojection', mstyle, ...
      'origin', origin, ...
      'maplatlimit', FRAME(3:4), ...
      'maplonlimit', FRAME(1:2));

%  Plot the data

contourfm(YAX2, XAX2, data2, clev);
axis_limits

set(gca, 'NextPlot', next_ax);