This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Set color used to draw ROI object

setColor is not recommended. Use one of the ROI classes instead, described in ROI Creation Overview.





setColor(h,color) sets the color used to draw the ROI object h.


collapse all

Display an image. Draw a polygon on the image, specifying the location of five vertices.

h = impoly(gca,[188,30; 189,142; 93,141; 13,41; 14,29]);

Set the color of the polygon to yellow.


Input Arguments

collapse all

ROI object, specified as an imellipse, imfreehand, imline, impoint, impoly, or imrect object.

RGB color value, specified as a 3-element numeric vector, or the long or short name of a predefined color, such as 'white' or 'w'. See ColorSpec for a list of predefined colors.

Introduced in R2008a