setString
Set text label for point ROI object
setString
is not recommended. With the new Point
ROI,
set the value of the Label
property instead. For more information,
see Version History.
Syntax
Description
Examples
Set Label of Point ROI
Display an image and create a point ROI.
imshow("rice.png")
h = impoint(gca,100,200);
Set the label of the ROI.
setString(h,"My point label");
Input Arguments
h
— Point ROI object
impoint
Point ROI object, specified as an impoint
object.
text
— Text label
string scalar | character vector
Text label, specified as a string scalar or character vector.
Data Types: string
| char
Version History
Introduced before R2006aR2018b: setString
is not recommended
Starting in R2018b, a new set of ROI objects replaces the existing set of ROI objects. The new objects provide more functional capabilities, such as face color transparency. The new classes also support events that you can use to respond to changes in your ROI such as moving or being clicked. Although there are no plans to remove the old ROI objects at this time, switch to the new ROIs to take advantage of the additional capabilities and flexibility. For more information on creating ROIs using the new ROI functions, see Create ROI Shapes.
To specify a label for a point ROI, assign a value to the Label
property of the ROI. Use the LabelVisible
property to control the
visibility of the label.
Update all instances of setString
method.
Discouraged Usage | Recommended Replacement |
---|---|
This example specifies a label for the point ROI using
the imshow("cameraman.tif"); h = impoint(gca,[100 100]); setString(h,"My Label"); | Create a point ROI using the new ROI objects and
replace use of the imshow("cameraman.tif"); h = drawpoint(gca,"Position",[100 100]); h.Label = "My Label"; |
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)