Why does a PLOT command in the timer function generate a new figure without plotting into the existing GUI?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I start a timer object, which has PLOT command in its TimerFcn, by clicking a button in my GUI. The first plot is plotted in the axes in my GUI as desired but subsequent plots are plotted in a new figure window.
I want to know how I can plot all the plots in the same axes in the GUI.
Akzeptierte Antwort
MathWorks Support Team
am 27 Jun. 2009
The HandleVisibility property of the figure window (for the GUI) and the axes is set to Callback by default. Thus, these handles will only be visible in a callback routine.
When you click the button and start the timer object, the first call to the TimerFcn will be within the callback and hence the axes in the GUI will be visible to it. The TimerFcn can plot into the axes in the GUI. However, subsequent plots from the TimerFcn are not from a callback. Hence, a new figure window is generated instead of plotting into the same axes in the GUI.
As a workaround, to be able to plot into the same axes, set the HandleVisibility property for the GUI (which can be obtained by double clicking anywhere on the GUIDE window except for a UIControl object) and for the axes to ON.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!