contour
Contour plot of a 2D scalar field.
Syntax
Section titled “Syntax”[C, h] = contour(Z)[C, h] = contour(Z, n)[C, h] = contour(X, Y, Z, ...)Description
Section titled “Description”Draws contour lines of Z over the (X, Y) grid. With n (integer), draws n automatically-chosen levels; with a vector of values, draws contours at those levels exactly.
Examples
Section titled “Examples”[X, Y] = meshgrid(-2:0.1:2);Z = X.*exp(-X.^2 - Y.^2);contour(X, Y, Z, 20)See also
Section titled “See also”contourf— Filled contour plot.contour3— 3D contour plot.contourslice— Contour slices through a 3D volume.mesh— 3D mesh (wireframe) plot.surf— 3D surface plot with colored faces.