
8 Programming the GUI
8-30
2 Add this code to the Plot 2 push button’s Callback callback. The contour
function displays the contour plot of a matrix, in this case the output of
peaks.
axes(handles.axes2)
contour(peaks(35));
3 Run the GUI by selecting Run from the Tools menu.
4 Click the Plot 1 button to display the surf plot in the first axes. Click the
Plot 2 button to display the contour plot in the second axes.
See “GUI with Multiple Axes” on page 10-2 for a more complex example that
uses two axes.
Note See “Axes Properties” in the MATLAB documentation for information
about properties that you can set to control many aspects of axes behavior and
appearance.
If your GUI contains axes, you should make sure that the
Command-line
accessibility
option in the GUI Options dialog box is set to Callback (the
Commentaires sur ces manuels