contour3
Draws contour lines at their own height in a 3-D view.
Category: Graphics > 2-D and 3-D Plots
Syntax
contour3(Z)
3-D contour lines of the matrix Z.
contour3(X, Y, Z)
Uses the coordinates X and Y.
contour3(___, levels)
Sets the number of levels or the level values.
h = contour3(___)
Also returns the contour object.
Description
Where contour flattens the lines onto a plane, contour3 draws each one at the height of its level, so the picture is a wireframe of the surface cut by horizontal planes. Rotate the plot to inspect it.
Input arguments
Z- Matrix of values.
X, Y- Grid coordinates.
levels- Number of levels or vector of level values.
Output arguments
h- The
Contourobject.
Example
Peaks in 3-D
[X, Y, Z] = peaks(30);
contour3(X, Y, Z, 12)
view(3)
In the app, the figure is drawn below the code.