AxesToolbar - Axes toolbar appearance and behavior - MATLAB (original) (raw)
AxesToolbar Properties
Axes toolbar appearance and behavior
AxesToolbar
properties control the appearance and behavior of the AxesToolbar
object. By changing property values, you can modify certain aspects of the toolbar.
f = uifigure; ax = uiaxes(f); tb = axtoolbar('default'); tb.Visible = 'off'; ax.Toolbar = tb;
Interactivity
Visibility of the axes toolbar when you hover over the axes, specified as'on'
or 'off'
, or as numeric or logical1
(true
) or 0
(false
). A value of 'on'
is equivalent totrue
, and 'off'
is equivalent tofalse
. 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 toolbar above the top-right corner of the axes when you hover over the axes.'off'
— Do not display the toolbar. You still can access the properties of an invisible toolbar.
Callbacks
Callback for selection changes, specified as one of these values:
- A function handle.
- A cell array in which the first element is a function handle. Subsequent elements in the cell array are the arguments to pass to the callback function.
- A character vector containing a valid MATLAB® expression (not recommended). MATLAB evaluates this expression in the base workspace.
This callback executes when you click a state button. It does not execute if a state button Value
property changes programmatically.
This callback function can access specific information about interaction with the buttons. MATLAB passes this information in a SelectionChangedEventData
object as the second argument to your callback function. You can query the object properties using dot notation. For example,event.Selection
returns the currently selected button. TheSelectionChangedEventData
object is not available to callback functions specified as character vectors.
This table lists the properties of the SelectionChangedEventData
object.
Property | Description |
---|---|
Axes | Array of Axes objects associated with the toolbar |
Selection | Currently selected button |
PreviousSelection | Previously selected button |
Source | AxesToolbar object |
EventName | 'SelectionChanged' |
Callback Execution Control
This property is read-only.
Parent/Child
Child buttons, specified as a graphics array of ToolbarPushButton
,ToolbarStateButton
, and ToolbarDropdown
objects. If you are using the default axes toolbar, then this property does not contain any children. However, if you create a custom toolbar using theaxtoolbar
function, then this property contains the child buttons.
Parent container, specified as an Axes
, PolarAxes
, or GeographicAxes
object.
Identifiers
This property is read-only.
Type of graphics object, returned as 'axestoolbar'
. Use this property to find all objects of a given type within a plotting hierarchy.
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 access to the object elsewhere in your code, you can use the findobj function to search for the object based on the Tag
value.
Unused Properties
Setting this property has no effect on objects of this type.
Mouse-click callback, specified as a function handle, a cell array, or a character vector.
Note
The axes toolbar does not use this property.
Version History
Introduced in R2018b