Contour plot of matrix
矩阵的等高线图
等高线图显示矩阵Z的等值线。使用clabel标记轮廓线。
contour(Z)
绘制矩阵Z的等高线图,其中Z被解释为相对于x-y平面的高度。 Z必须至少是包含至少两个不同值的2乘2的矩阵。 x值对应于Z的列索引,y值对应于Z的行索引。自动选择轮廓级别。
contour(Z,n)
绘制具有n个轮廓水平的矩阵Z的等高线图,其中n是标量。 自动选择轮廓水平。
contour(Z,v)
绘制矩阵Z的等高线图,轮廓线位于单调增加矢量v中指定的数据值。要在特定值处显示单个轮廓线,请将v定义为具有两个元素的双元素矢量 等于所需的轮廓水平。 例如,要在级别k绘制轮廓线,请使用轮廓(Z,[k k])。 指定向量v会将LevelListMode属性设置为手动。
contour(X,Y,Z)
, contour(X,Y,Z,n)
, and contour(X,Y,Z,v)
draw contour plots of Z
using X
and Y
to determine the x and y values.
-
If
X
andY
are vectors, thenlength(X)
must equalsize(Z,2)
andlength(Y)
must equalsize(Z,1)
. The vectors must be strictly increasing or strictly decreasing and cannot contain any repeated values. -
If
X
andY
are matrices, then their sizes must equal the size ofZ
. Typically, you should setX
andY
so that the columns are strictly increasing or strictly decreasing and the rows are uniform (or the rows are strictly increasing or strictly decreasing and the columns are uniform).
If X
or Y
is irregularly spaced, then contour
calculates contours using a regularly spaced contour grid, and then transforms the data to X
or Y
.
如果 X 和 Y 是向量,则 length(X) 必须等于 size(Z,2),也即是Z的列数,length(Y) 必须等于 size(Z,1),也即是Z的行数。 向量必须严格增加或严格减少,并且不能包含任何重复值。