contour3
Creates 3D contoured surface in an axes.
Syntax
contour3(z)
contour3(x, y, z)
contour3(hAxes, ...)
contour3(..., cn)
Inputs
- x, y, z
- Range of the x, y, and z axes.
- hAxes
- Axis handle.
- cn
- Optional argument to set the number of contours, changing the number of colors in the colormap. The number of colors is limited to 32.
Examples
cla;
x=[0:0.15:2*pi];
y=x;
z=sin(x')*cos(y);
contour3(z);
colorbar;
cla;
x=[0:0.15:2*pi];
y=x;
z=sin(x')*cos(y);
contour3(z, 4);
colorbar;
Comments
If there are no axes, one will be created first. If x and y are omitted, the index of the z column is used for the x coordinate and the index of the z row is used for the y coordinate. If the first argument of contour3() is an axis handle, surfaces are created in that axis.