Plot a 3-D wireframe mesh with underlying contour lines.
The wireframe mesh is plotted using rectangles. The vertices of the
rectangles [x, y] are typically the output of meshgrid
.
over a 2-D rectangular region in the x-y plane. z determines the
height above the plane of each vertex. If only a single z matrix is
given, then it is plotted over the meshgrid
x = 1:columns (z), y = 1:rows (z)
.
Thus, columns of z correspond to different x values and rows
of z correspond to different y values.
The color of the mesh is computed by linearly scaling the z values
to fit the range of the current colormap. Use caxis
and/or
change the colormap to control the appearance.
Optionally the color of the mesh can be specified independently of z by supplying a color matrix, c.
Any property/value pairs are passed directly to the underlying surface object.
If the first argument hax is an axes handle, then plot into this axis,
rather than the current axes returned by gca
.
The optional return value h is a 2-element vector with a graphics handle to the created surface object and to the created contour plot.
See also: ezmeshc, mesh, meshz, contour, surfc, surface, meshgrid, hidden, shading, colormap, caxis.
The following code
clf; colormap ("default"); [X, Y] = meshgrid (linspace (-3, 3, 40)); Z = sqrt (abs (X .* Y)) ./ (1 + X.^2 + Y.^2); meshc (X, Y, Z); title ("meshc() combines mesh/contour plots");
Produces the following figure
Figure 1 |
---|
Package: octave