C = contour(...)
contour(Z)draws a contour plot of matrix
Z. The contours are level lines in the units of array
Z. The lower-left corner of the plot corresponds to
Z(1,1). The number of contour lines and their values are chosen automatically by
contour(Z,n) produces a contour plot of matrix
n contour levels.
contour(Z,v) draws a contour plot of
Z with contour levels at the values specified in vector
contour(x,y,Z,v) produce contour plots of
Z and use the data in vectors
y to control the axis scaling on the x- and y-axes. The elements of
y are equally spaced.
C = contour(...) returns the contour matrix
C as described in the
contourc and used by
To label the levels of a contour plot, see
over the range -2 <= x <= 2, -2 <= y <= 3, use the statements:
x = -2:.2:2;
y = -2:.2:3;
[X,Y] = meshgrid(x,y);
Z = X.*exp(-X.^2-Y.^2);
Zis less than 2:
Matrix must be 2-by-2 or larger.
contourassumes that vectors
yare monotonically increasing. If
yare irregularly spaced, the contours are simply stretched apart, which is not the same as contouring the irregularly spaced data.
(c) Copyright 1994 by The MathWorks, Inc.