contour

Creates 2D contoured surface in an axes.

Syntax

contour(z)

contour(x, y, z)

contour(..., style)

contour(hAxes, ...)

Inputs

x, y, z
Range of the x, y and z axes.
Type: double | integer
Dimension: scalar | vector | matrix
vn
Contour levels.
Type: double | integer
Dimension: scalar | vector
style
Style of the contour lines.
Type: string
Dimension: scalar
hAxes
Axis handle.
Type: double
Dimension: scalar

Example

Contour example:

cla;
x=[0:0.1:2*pi];
y=x;
z=sin(x')*cos(y);
contour(z)


Comments

If there is no axes, one will be created first. If x and y are omitted, the index of the columns of z is used for x coordinates and the index of the rows of z is used for y coordinates. contour () takes optional arguments to control the surface style. It can be either the contour levels or the contour line style, or both. If the first argument of contour () is an axes handle, surfaces will be created in that axes.