MATLAB Functions | Help Desk |
clabel
Contour plot elevation labelsclabel(C,h) clabel(C,h,v) clabel(C,h,'manual') clabel(C) clabel(C,v) clabel(C,'manual')The
clabel
function adds height labels to a two-dimensional contour plot.
clabel(C,h)
rotates the labels and inserts them in the contour lines. The function inserts only those labels that fit within the contour, due to the size of the contour.
clabel(C,h,v)
creates labels only for those contour levels given in vector v
, then rotates the labels and inserts them in the contour lines.
clabel(C,h,'manual')
places contour labels at locations you select with a mouse. You press the left mouse button (the only mouse button on a single-button mouse), or the space bar to label a contour at the closest location beneath the center of the cursor. Press the Return key while the cursor is within the Figure window to terminate labeling. The labels are rotated and inserted in the contour lines.
clabel(C)
adds labels to the current contour plot using the contour structure C
output from contour
. The function labels all contours displayed and randomly selects label positions.
clabel(C,v)
labels only those contour levels given in vector v
.
clabel(C,'manual')
places contour labels at locations you select with a mouse.
When the syntax includes the argument h
, this function rotates the labels and inserts them in the contour lines (see Example). Otherwise, the labels are displayed upright and a '+'
indicates which contour line the label is annotating.
Generate, draw, and label a simple contour plot:
[x,y] = meshgrid(-2:.2:2); z = x.^exp(-x.^2-y.^2); [C,h] = contour(x,y,z); clabel(C,h);
contour
, contourc
, contourf