Control toolbar appearance and behavior
A toolbar is a container for a horizontal list of buttons at the top of a figure
uitoolbar function creates a toolbar in a figure and sets any
required properties before displaying it. By changing property values, you can modify the
appearance and behavior of a toolbar. Use dot notation to refer to a particular object and
tb = uitoolbar; tb.Visible = 'off';
ContextMenu — Context menu
GraphicsPlaceholder array (default) |
Setting this property has no effect on objects of this type.
Callback Execution Control
Parent — Parent object
Parent object, specified as a
Figure object created with either
figure function. If a parent figure is not specified, then MATLAB calls the
figure function to create one that serves
as the parent.
You can move a
Toolbar object to a different figure by setting
this property to the target
GraphicsPlaceholder array (default) | 1-D array of component objects
Toolbar children, returned as an empty
GraphicsPlaceholder or a 1-D array of component objects. The
Toolbar objects are
You cannot add or remove children using the
Use this property to view the list of children or to reorder the children. The order of
the children in this array reflects the right-to-left order of the tools displayed in
the toolbar. Meaning that the right-most tool is at the top of the list and the
left-most tool is at the bottom of the list. For example, this tool order returned by
Children property indicates that the push tool appears to the
left of the toggle tool in the
toolOrder = tb.Children
toolOrder = 2×1 graphics array: ToggleTool PushTool
To add a child to this list, set the
property of the child component to the
Objects with the
'off' are not listed in the
HandleVisibility — Visibility of object handle
'on' (default) |
Visibility of object handle, specified as
This property controls the visibility of the object in its parent's list of children. When an
object is not visible in its parent's list of children, it is not returned by functions
that obtain objects by searching the object hierarchy or querying properties. These
HandleVisibility property also controls the visibility of the
object’s handle in the parent figure's
Objects are valid even if they are not visible. If you can access an object, you can set
and get its properties, and pass it to any function that operates on
|The object handle is always visible.|
|The object handle is visible from within callbacks or functions invoked by callbacks, but not from within functions invoked from the command line. This option blocks access to the object at the command line, but allows callback functions to access it.|
|The object handle is invisible at all times. This option is
useful for preventing unintended changes to the UI by another
function. Set the |
Type — Type of graphics object
This property is read-only.
Type of graphics object, returned as
uifigure-Based Apps Only
BackgroundColor — Background color
[0.9569 0.9569 0.9569] (default) | RGB triplet | hexadecimal color code |
'b' | ...
This property can be modified only for toolbars in App Designer and in apps
created using the
Background color, specified as an RGB triplet, a hexadecimal color code, or one of the color options listed in the table.
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 from
F. The values are not case sensitive. Thus, the color codes
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|
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|
Introduced before R2006a