Main Content

setLabelTextFormatter

Set format used to display text label of Distance tool

setLabelTextFormatteris not recommended. Use one of the ROI classes instead, described inCreate ROI Shapes.

Description

example

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

Examples

Format Label of Distance Tool

Display an image and create a Distance tool.

imshow('pout.tif') 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 animdistlineobject.

Text format of Distance tool label, specified as a character array in a format expected bysprintf.

Introduced before R2006a