Main Content


Set format used to display text label of Distance tool

setLabelTextFormatter is not recommended. Use one of the ROI classes instead, described in Create ROI Shapes.



setLabelTextFormatter(h,str) sets the format used to display the label text of the Distance tool, h.


collapse all

Display an image and create a Distance tool.

hline = imdistline(gca,[71 171],[108 150]);

Modify the format of the label to indicate that distance is measured in pixels.

setLabelTextFormatter(hline,"%02.0f pixels");

Input Arguments

collapse all

Distance tool, specified as an imdistline object.

Text format of Distance tool label, specified as a string scalar or character vector in a format expected by sprintf.

Version History

Introduced before R2006a