User`s guide
GUI with Axes, Menu, and Toolbar
• Setting the HandleVisib ility property to callback ensures that the
figure can be accessed only from within a GUI callback, and cannot be
drawn into or deleted from the command line.
• The
Color property defines the background color of the figure. In this
case, it is set to be the same as the default background color of
uicontrol
objects, such as the Update push button. The factory default background
color of
uicontrol objects is the system default and can vary from system
to system. This statement ensures that the figure’s background color
matches the background color of the components.
See the Figure Properties reference page for information about figure
properties and their default values.
The Axes
The following statement creates t he axes.
hPlotAxes = axes(... % Axes for plotting the selected plot
'Parent', hMain Figu re, ...
'Units', 'norma lize d', ...
'HandleVisibility','callback', ...
'Position',[0.11 0.13 0.80 0.67]);
• The axes function creates the axes. Setting the axes Parent property to
hMainFigure makes it a child of the main figure.
• Setting the
Units property to normalized ensures that the axes resizes
proportionately when the GUI is resized.
• The
Position property is a 4-element vector that specifies the location of
the axes within the figure and its size: [distance from left, distance from
bottom, width, height]. Because the units are normalized, all values are
between 0 and 1.
Note If you specify the U nits property, then the Position property, and
any other properties that depend on the value of the
Units property, should
follow the
Units property specification.
15-9