ROCCurve Properties
ROCCurve
properties control the appearance and behavior of a
ROCCurve
object, which the plot
function of a
rocmetrics
object returns
for each receiver operating characteristic (ROC) curve or other performance
curve.
By changing property values, you can modify certain aspects of the ROC curve. Use dot notation to query and set properties; for example:
rocObj = rocmetrics(Labels,Scores,ClassNames); curveObj = plot(rocObj); c = curveObj(1).Color; curveObj(1).Color = "red";
ROC Curve Data
XAxisMetric
— Performance metric for x-axis
name of performance metric
This property is read-only.
Performance metric for the x-axis, stored in XData
, specified as
a string scalar of the performance metric name.
The XAxisMetric
name-value argument of the plot
function sets this property. The
default value of this argument is "FalsePositiveRate"
.
For details about built-in and custom metric names, see the XAxisMetric
name-value argument of the plot
function.
XData
— x-axis values
numeric vector
This property is read-only.
x-axis values for XAxisMetric
,
specified as a numeric vector.
Data Types: double
YAxisMetric
— Performance metric for y-axis
name of performance metric
This property is read-only.
Performance metric for the y-axis, stored in YData
, specified as
a string scalar of the performance metric name.
The YAxisMetric
name-value argument of the plot
function sets this property. The
default value of this argument is "TruePositiveRate"
.
For details about built-in and custom metric names, see the XAxisMetric
name-value argument of the plot
function.
YData
— y-axis values
numeric vector
This property is read-only.
y-axis values for YAxisMetric
,
specified as a numeric vector.
Data Types: double
ROC Curve Options
ShowConfidenceIntervals
— Flag to show confidence intervals
true
or 1
| false
or 0
Flag to show the confidence intervals for the y-axis metric (YAxisMetric
),
specified as logical 1
(true
) or
0
(false
).
The ShowConfidenceIntervals
name-value argument of the
plot
function sets this property. The default value of the
argument is false
.
The ShowConfidenceIntervals
value can be true
only if
the Metrics
property of
the rocmetrics
object
contains the confidence intervals for the y-axis metric.
Color
Color
— Color of line and confidence interval shading
RGB triplet | hexadecimal color code | 'r'
| 'g'
| 'b'
| ...
Color of the line and confidence interval shading, specified as an RGB triplet, hexadecimal color code, color name, or short name.
RGB triplets and hexadecimal color codes are useful for specifying custom colors.
An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range
[0,1]
; for example,[0.4 0.6 0.7]
.A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol (
#
) followed by three or six hexadecimal digits, which can range from0
toF
. The values are not case sensitive. Thus, the color codes"#FF8800"
,"#ff8800"
,"#F80"
, and"#f80"
are equivalent.
Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.
Color Name | Short Name | RGB Triplet | Hexadecimal Color Code | Appearance |
---|---|---|---|---|
"red" | "r" | [1 0 0] | "#FF0000" | |
"green" | "g" | [0 1 0] | "#00FF00" | |
"blue" | "b" | [0 0 1] | "#0000FF" | |
"cyan"
| "c" | [0 1 1] | "#00FFFF" | |
"magenta" | "m" | [1 0 1] | "#FF00FF" | |
"yellow" | "y" | [1 1 0] | "#FFFF00" | |
"black" | "k" | [0 0 0] | "#000000" | |
"white" | "w" | [1 1 1] | "#FFFFFF" |
Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB® uses in many types of plots.
RGB Triplet | Hexadecimal Color Code | Appearance |
---|---|---|
[0 0.4470 0.7410] | "#0072BD" | |
[0.8500 0.3250 0.0980] | "#D95319" | |
[0.9290 0.6940 0.1250] | "#EDB120" | |
[0.4940 0.1840 0.5560] | "#7E2F8E" | |
[0.4660 0.6740 0.1880] | "#77AC30" | |
[0.3010 0.7450 0.9330] | "#4DBEEE" | |
[0.6350 0.0780 0.1840] | "#A2142F" |
Example: 'blue'
Example: [0 0 1]
Example: '#0000FF'
ColorMode
— Mode for setting Color
'auto'
(default) | 'manual'
Mode for setting the Color
property, specified as one of these values:
'auto'
— The software controls the value of theColor
property by using theSeriesIndex
property of theROCCurve
object and theColorOrder
property of the axes.'manual'
— You control the value of theColor
property manually by setting the value of theColor
property directly on the object.
If you change the value of the Color
property manually, the software changes the value of the ColorMode
property to 'manual'
.
Line
LineStyle
— Line style
'-'
(default) | '--'
| ':'
| '-.'
| 'none'
Line style, specified as one of the options in this table.
Line Style | Description | Resulting Line |
---|---|---|
"-" | Solid line |
|
"--" | Dashed line |
|
":" | Dotted line |
|
"-." | Dash-dotted line |
|
"none" | No line | No line |
LineStyleMode
— Mode for setting LineStyle
'auto'
(default) | 'manual'
Mode for setting the LineStyle
property, specified as one of these values:
'auto'
— The software controls the value of theLineStyle
property by using theSeriesIndex
property of theROCCurve
object and theLineStyleOrder
property of the axes.'manual'
— You control the value of theLineStyle
property manually by setting the value of theLineStyle
property directly on the object.
If you change the value of the LineStyle
property manually, the software changes the value of the LineStyleMode
property to 'manual'
.
LineWidth
— Line width
0.5
(default) | positive value
Line width, specified as a positive value in points, where 1 point = 1/72 of an inch. If the line has markers, then the line width also affects the marker edges.
The line width cannot be thinner than the width of a pixel. If you set the line width to a value that is less than the width of a pixel on your system, the line is displayed one pixel wide.
SeriesIndex
— Series index
positive whole number | "none"
Series index, specified as a positive whole number or "none"
. This property
is useful for reassigning the colors, line styles, or markers of several
ROCCurve
objects so that they match each other. By default, the
SeriesIndex
property of a ROCCurve
object is a
number that corresponds to its order of creation, starting at
1
.
The software uses the number to calculate indices for assigning color, line style, or markers
when you call plotting functions. The indices refer to the rows of the arrays stored in
the ColorOrder
and LineStyleOrder
properties
of the axes. The software automatically updates the color, line style, or markers of the
ROCCurve
object when you change its
SeriesIndex
, or when you change the
ColorOrder
or LineStyleOrder
properties of
the axes.
The following conditions must be true for the changes to have any effect:
At least one of these properties of the
ROCCurve
object is set to'auto'
:ColorMode
,LineStyleMode
, orMarkerMode
.The
SeriesIndex
property of theROCCurve
object is greater than0
.The
NextSeriesIndex
property of the axes object is greater than0
.
Markers
Marker
— Marker symbol
'none'
| 'o'
| '+'
| '*'
| '.'
| ...
Marker symbol, specified as one of the values in this table. By default, the object does not display markers. Specifying a marker symbol adds markers at each data point or vertex.
Marker | Description | Resulting Marker |
---|---|---|
"o" | Circle |
|
"+" | Plus sign |
|
"*" | Asterisk |
|
"." | Point |
|
"x" | Cross |
|
"_" | Horizontal line |
|
"|" | Vertical line |
|
"square" | Square |
|
"diamond" | Diamond |
|
"^" | Upward-pointing triangle |
|
"v" | Downward-pointing triangle |
|
">" | Right-pointing triangle |
|
"<" | Left-pointing triangle |
|
"pentagram" | Pentagram |
|
"hexagram" | Hexagram |
|
"none" | No markers | Not applicable |
MarkerMode
— Mode for setting Marker
'auto'
(default) | 'manual'
Mode for setting the Marker
property, specified as one of these values:
'auto'
— The software controls the value of theMarker
property by using theSeriesIndex
property of theROCCurve
object and theLineStyleOrder
property of the axes.'manual'
— You control the value of theMarker
property manually by setting the value of theMarker
property directly on the object.
If you change the value of the Marker
property manually, the software changes the value of the MarkerMode
property to 'manual'
.
Legend
DisplayName
— Text used in legend
character vector
Text used in the legend, specified as a character vector.
The default value of DisplayName
is the name of the class for which the curve describes the performance. If the curve is a ROC curve, then DisplayName
also contains the area under the ROC curve (AUC) value.
Alternatively, you can specify the legend text using the legend
function.
If you interactively edit the character vector in an existing legend, then the software updates the DisplayName
property to the edited character vector.
Annotation
— Control for legend
Annotation
object
Control for including the ROCCurve
object in the legend or excluding the object from the legend, specified as an Annotation
object. Set the underlying IconDisplayStyle
property to one of these values:
'on'
— Include theROCCurve
object in the legend (default).'off'
— Do not include theROCCurve
object in the legend.
For example, to exclude the ROCCurve
object curveObj
from the legend, set the IconDisplayStyle
property to 'off'
.
curveObj.Annotation.LegendInformation.IconDisplayStyle = 'off';
Alternatively, you can control the items in a legend using the legend
function. Specify the first input argument as a vector of the graphics objects to include. If you do not specify an existing graphics object in the first input argument, then it does not appear in the legend. However, graphics objects added to the axes after the legend is created do appear in the legend. Consider creating the legend after creating all the plots to avoid extra items.
Interactivity
Visible
— State of visibility for object
'on'
(default) | on/off logical value
State of visibility for an object, specified as 'on'
or 'off'
, or as numeric or logical 1
(true
) or 0
(false
). A value of 'on'
is equivalent to true
, and 'off'
is equivalent to false
. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState
.
'on'
— Display the object.'off'
— Hide the object without deleting it. You still can access the properties of an invisible object.
DataTipTemplate
— Data tip content
DataTipTemplate
object
Data tip content, specified as a DataTipTemplate
object. You can control the content that appears in a data tip by modifying the properties of the underlying DataTipTemplate
object. For a list of properties, see DataTipTemplate Properties.
For an example of modifying data tips, see Create Custom Data Tips.
Note
The DataTipTemplate
object is not returned by findobj
or findall
, and it is not copied by copyobj
.
Selected
— Selection state of object
'off'
(default) | on/off logical value
Selection state of an object, specified as 'on'
or 'off'
, or as numeric or logical 1
(true
) or 0
(false
). A value of 'on'
is equivalent to true, and 'off'
is equivalent to false
. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState
.
'on'
— The object is selected. If you click the object when editing the plot, the software sets the object'sSelected
property to'on'
. If theSelectionHighlight
property is also set to'on'
, the software displays selection handles around the object.'off'
— The object is not selected.
SelectionHighlight
— Display of selection handles
'on'
(default) | on/off logical value
Display of selection handles when an object is selected, specified as 'on'
or 'off'
, or as numeric or logical 1
(true
) or 0
(false
). A value of 'on'
is equivalent to true, and 'off'
is equivalent to false
. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState
.
'on'
— Display selection handles around the object when theSelected
property is set to'on'
.'off'
— Do not display selection handles around the object, even when theSelected
property is set to'on'
.
Callback Execution Control
PickableParts
— Ability to capture mouse clicks
'visible'
(default) | 'all'
| 'none'
Ability to capture mouse clicks, specified as one of these values:
'visible'
— Capture mouse clicks when they are visible. TheVisible
property must be set to'on'
and you must click a part of theROCCurve
object that has a defined color. You cannot click a part that has an associated color property set to'none'
. If the plot contains markers, then the entire marker is clickable if either the edge or the fill has a defined color. TheHitTest
property determines if theROCCurve
object responds to the click or if an ancestor does.'all'
— Capture mouse clicks regardless of visibility. TheVisible
property can be set to'on'
or'off'
and you can click a part of theROCCurve
object that has no color. TheHitTest
property determines if theROCCurve
object responds to the click or if an ancestor does.'none'
— Mouse clicks cannot be captured. Clicking theROCCurve
object passes the click to the object below it in the current view of the figure window. TheHitTest
property has no effect.
HitTest
— Response to captured mouse clicks
'on'
(default) | on/off logical value
Response to captured mouse clicks, specified as 'on'
or 'off'
, or as numeric or logical 1
(true
) or 0
(false
). A value of 'on'
is equivalent to true, and 'off'
is equivalent to false
. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState
.
'on'
— Create a data tip at a data point of theROCCurve
object.'off'
— Trigger the callbacks for the nearest ancestor of theROCCurve
object that has one of these:HitTest
property set to'on'
PickableParts
property set to a value that enables the ancestor to capture mouse clicks
Note
The PickableParts
property determines if the ROCCurve
object can capture mouse clicks. If it cannot, then the HitTest
property has no effect.
Parent/Child
Parent
— Parent
Axes
object
Parent, specified as an Axes
object.
Children
— Children
empty GraphicsPlaceholder
array | DataTip
object array
Children, specified as an empty GraphicsPlaceholder
array or a DataTip
object array. Use this property to view a list of data tips plotted on the performance curve.
You cannot add or remove children using the Children
property. To add a child to this list, set the Parent
property of the DataTip
object to the ROCCurve
object.
HandleVisibility
— Visibility of object handle
'on'
(default) | 'off'
| 'callback'
Visibility of the object handle in the Children
property of the parent, specified as one of these values:
'on'
— The object handle is always visible.'off'
— The object handle is invisible at all times. This option is useful for preventing unintended changes by another function. SetHandleVisibility
to'off'
to temporarily hide the handle during the execution of that function.'callback'
— The object handle is visible from callbacks or functions invoked by callbacks, but not from functions invoked from the command line. This option blocks access to the object at the command line, but permits callback functions to access the object.
If the object is not listed in the Children
property of the parent, then functions that obtain object handles by searching the object hierarchy or querying handle properties cannot return the object. Examples of such functions include the get
, findobj
, gca
, gcf
, gco
, newplot
, cla
, clf
, and close
functions.
Hidden object handles are still valid. Set the root ShowHiddenHandles
property to 'on'
to list all object handles regardless of their HandleVisibility
property setting.
Identifier
Type
— Type of graphics object
'roccurve'
This property is read-only.
Type of graphics object, specified as 'roccurve'
. Use this property to find all objects of a given type within a plotting hierarchy, for example, searching for the type using findobj
.
Tag
— Object identifier
''
(default) | character vector | string scalar
Object identifier, specified as a character vector or string scalar. You can specify a unique Tag
value to serve as an identifier for an object. When you need to access the object elsewhere in your code, you can use the findobj
function to search for the object based on the Tag
value.
UserData
— User data
[]
(default) | array
User data, specified as any MATLAB array. For example, you can specify a scalar, vector, matrix, cell array, character array, table, or structure. Use this property to store arbitrary data on an object.
If you are working in App Designer, create public or private properties in the app to share data instead of using the UserData
property. For more information, see Share Data Within App Designer Apps.
Version History
Introduced in R2022aR2023b: Opt Out of Automatic Color and Line Style Selection with
SeriesIndex="none"
Opt out of automatic color and line style selection for ROCCurve
objects by setting the SeriesIndex
property to
"none"
. When you specify "none"
, the
ROCCurve
object has a solid line style and a neutral color with no
markers.
To enable automatic selection again, set the SeriesIndex
property
to a positive whole number.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)