FUNCTION REFERENCE
clabel
Contour labels.
Contour labels.
Syntax
t = clabel(C)Syntax
t = clabel(C, v)Syntax
t = clabel(C, h)Syntax
t = clabel(C, h, v)Writes the level of every contour line, formatted with %g, at the line's midpoint by arc length, as a text object in the axes font size (centred, no background). With h (from contour or contourf) the labels belong to that contour and follow it when its levels change, like ShowText 'on'; v labels only those levels. Without h the labels are placed on the current axes from C alone. With h and a C that is not the contour's own, the labels sit on the lines of that C. A C that is not a contour matrix (a block without points, a count beyond the matrix) is an error. Returns the text handles.
Example
[C, h] = contour(peaks(20), [0 2]); t = clabel(C, h); get(t(1), 'String')Example
C = contourc(peaks(20), [1 1]); t = clabel(C);Differences from MATLAB: no '+' markers, no manual placement, no LabelSpacing; the lines are not broken under the labels. At most 256 text objects per axes.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.