Plot a contour graph under mesh graph
h = meshc(...)
meshc(X,Y,Z) draws a wireframe
mesh and a contour plot under it with color determined by
so color is proportional to surface height. If
length(X) = n and
[m,n] = size(Z). In this case,
(X(j), Y(i), Z(i,j))
are the intersections of the wireframe grid lines;
to the columns and rows of
Z, respectively. If
matrices, (X(i,j), Y(i,j), Z(i,j))
are the intersections of the wireframe grid lines.
meshc(Z) draws a contour
plot under wireframe mesh using
X = 1:n and
= 1:m, where
[m,n] = size(Z). The height,
is a single-valued function defined over a rectangular grid. Color
is proportional to surface height.
meshc(...,C) draws a
with color determined by matrix
C. MATLAB® performs
a linear transformation on the data in
C to obtain
colors from the current colormap. If
Z are matrices, they must be the same size
into the axes with handle
axes_handle instead of
the current axes (
meshc to display a combination of a mesh plot and a contour plot of the
figure [X,Y] = meshgrid(-3:.125:3); Z = peaks(X,Y); meshc(Z)
meshc does not accept complex inputs.
A mesh is drawn as a
object with the viewpoint specified by
The face color is the same as the background color (to simulate a
wireframe with hidden-surface elimination), or
drawing a standard see-through wireframe. The current colormap determines
the edge color. The
hidden command controls the
simulation of hidden-surface elimination in the mesh, and the
controls the shading model.
The range of
C, or the current settings of the axes
CLimMode properties (also
set by the
caxis function), determine the color scaling. Use the
scaled color values are used as indices into the current colormap.
The mesh rendering functions produce color values by mapping
the z data values (or an explicit color array)
onto the current colormap. The MATLAB default behavior is to
compute the color limits automatically using the minimum and maximum
data values (also set using
caxis auto). The minimum
data value maps to the first color value in the colormap and the maximum
data value maps to the last color value in the colormap. MATLAB performs
a linear transformation on the intermediate values to map them to
the current colormap.
and then calls
contour and positions the contour
on the x-y plane. For additional
control over the appearance of the contours, issue these commands
directly. You can combine other types of graphs in this manner, for
meshc assumes that
monotonically increasing. If
contour3 calculates contours
using a regularly spaced contour grid, and then it transforms the
Usage notes and limitations:
This function accepts GPU arrays, but does not run on a GPU.
For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Usage notes and limitations:
This function operates on distributed arrays, but executes in the client MATLAB.
For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).