Specifications

User Interface Controls
1-37
makes the axes whose Tag property is axes1 the current axes, and therefore the
target for plotting commands. You can switch the current axes whenever you
want to target a different axes. See GUI with Multiple Axes for and example
that uses two axes.
Figure
Figures are the windows that contain the GUI you design with the Layout
Editor. See the description of figure properties for information on what figure
characteristics you can control.
Displaying Plots in a Separate Figure
To prevent a figure from becoming the target of plotting commands issued at
the command line or by other GUIs, you can set the
HandleVisibility and
IntegerHandle properties to off. However, this means the figure is also
hidden from plotting commands issued by your GUI.
To issue plotting commands from your GUI, you should create a figure and
axes, saving the handles (you can store them in the
handles structure). You
then parent the axes to the figure and then parent the graphics objects created
by the plotting command to the axes. The following steps summarize this
approach:
Save the handle of the figure when you create it.
Create an axes, save its handle, and set its
Parent property to the figure
handle.
Create the plot, and save the handles, and set their
Parent properties to the
handle of the axes.
The following code illustrates these steps.
fHandle = figure('HandleVisibility','off','IntegerHandle','off',...
'Visible','off');
aHandle = axes('Parent',fHandle);
pHandles = plot(PlotData,'Parent',aHandle);
set(fHandle,'Visible','on')
Note that not all plotting commands accept property name/property value
specifications as arguments. Consult the reference page for the specific
command to see what arguments you can specify.