Graphics Previous page   Next Page

Labeling Contours

Each contour level has a value associated with it. clabel uses these values to display labels for 2-D contour lines. The contour matrix contains the values clabel uses for the labels. This matrix is returned by contour, contour3, and contourf and is described in The Contouring Algorithm.

clabel optionally returns the handles of the text objects used as labels. You can then use these handles to set the properties of the label string.

For example, display 10 contour levels of the peaks function,

then label the contours and display a title.

Note that clabel labels only those contour lines that are large enough to have an inline label inserted.

The 'manual' option enables you to add labels by selecting the contour you want to label with the mouse.

You can also use this option to label only those contours you select interactively.

For example,

displays a crosshair cursor when your cursor is inside the figure. Pressing any mouse button labels the contour line closest to the center of the crosshair.


Previous page  Creating Simple Contour Plots Filled Contours Next page

© 1994-2005 The MathWorks, Inc.