function varargout = contour3m(varargin)
%CONTOUR3M Create a 3D contour plot of a data grid.
%
%  CONTOUR3M(Z,R) displays a contour plot of the regular M-by-N data grid,
%  Z.  R is a referencing matrix or referencing vector. If the current axis
%  is a map axis, the coordinates of Z will be projected using the
%  projection structure from the axis. The contours are drawn at their
%  corresponding Z level.
%
%  CONTOUR3M(LAT, LON, Z) displays a contour plot of the geolocated M-by-N
%  data grid, Z.  LAT and LON can be the size of Z or can specify the 
%  corresponding row and column dimensions for Z.
%
%  CONTOUR3M(Z, R, N) or CONTOUR3M(LAT, LON, N) where N is a scalar, draws
%  N contour levels.
%
%  CONTOUR3M(Z, R, V) or CONTOUR3M(LAT, LON, V) where V is a vector, draws 
%  contours at the levels specified by the input vector V. Use V = [v v] to 
%  compute a single contour at level v. 
%
%  CONTOUR3M(..., LINESPEC) uses any valid LineSpec string to draw the 
%  contour lines.
%
%  CONTOUR3M(..., PROP1, VAL1, PROP2, VAL2,...) specifies property/value
%  pairs that modify LINE graphics properties. Property names can be
%  abbreviated and are case-insensitive.
%
%  C = CONTOUR3M(...) returns a standard contour matrix, C, with the first
%  row representing longitude data and the second row representing latitude
%  data.
%
%  [C,H] = CONTOUR3M(...) returns the contour matrix and the line handles
%  to the contour lines drawn onto the current axes.
%
%
%  % Example 1
%  % ---------
%  % Contour the topography data
%  load topo
%  axesm robinson; framem; view(3)
%  contour3m(topo,topolegend)
%  set(gca,'DataAspectRatio',[1 1 3000])
%
%
%  % Example 2
%  % ---------
%  % Contour the EGM96 geoid heights as a 3d surface with 50 levels and
%  % set the patch edge color to black.
%  load geoid
%  figure
%  [c,h]=contour3m(geoid, geoidrefvec, 50,'EdgeColor','black');
%   
%  % Add the geoid surface.
%  hold on
%  geoshow(geoid,geoidrefvec,'DisplayType','surface')
%
%  % Add a title.
%  title('EGM96 Geoid Heights with 50 Contour Levels');
%
%
%  % Example 3
%  % ---------
%  % Display the EGM96 geoid height contours in a world map.
%  load geoid
%  figure
%  worldmap('world');
%
%  % Contour the geoid height with 10 levels and 
%  % set the color to magenta.
%  [c,h]=contour3m(geoid, geoidrefvec, 10,'m');
%
%  % Add the geoid surface.
%  hold on
%  geoshow(geoid,geoidrefvec,'DisplayType','surface')
%
%  % Set the surface to the minimum height of the geoid.
%  % to keep the contours visible.
%  zdatam(handlem('surface'),min(geoid(:)));
%
%  % Add a title.
%  title('EGM96 Geoid Heights with 50 Contour Levels');
%
%  See also CLABEL, CONTOUR3, CONTOUR, CONTOURM, GEOSHOW, PLOT.

%  Copyright 1996-2004 The MathWorks, Inc.
%  $Revision: 1.3.4.2 $    $Date: 2004/08/27 15:15:52 $

% Check inputs and evaluate the contour3m function.
varargout = calcContour(mfilename, @contour3, nargout, varargin{:});

