Graphics Previous page   Next Page

Creating Simple Contour Plots

contour and contour3 display 2- and 3-D contours, respectively. They require only one input argument -- a matrix interpreted as heights with respect to a plane. In this case, the contour functions determine the number of contours to display based on the minimum and maximum data values.

To explicitly set the number of contour levels displayed by the functions, you specify a second optional argument.

Contour Plot of the Peaks Function

The statements

display 20 contours of the peaks function in a 2-D view.

The statements

display 20 contours of the peaks function in a 3-D view and increase the line width to 2 points.


Previous page  Contour Plots Labeling Contours Next page

© 1994-2005 The MathWorks, Inc.