How do I plot on a tab within a tabgroup in Appdesigner?
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Ranjan Sonalkar
il 22 Dic 2021
Commentato: Ranjan Sonalkar
il 22 Dic 2021
I am designing a GUI in appdesigner. I have added a tabgroup and dragged an Axes on to one of the tabs. What is the syntax for drawing in this Axes where I want to plot my own data that is generated after a button-push in the app?
Risposta accettata
Cris LaPierre
il 22 Dic 2021
Make sure the axes are part of the tab group (the tab background will change color when adding a component to it). Once done, plot to the axes the same as when it's not in a tab group. The only trick in app designer is to be sure to specify the target axes.
Here is what my simple example code looked like
% Button pushed function: Button
function ButtonPushed(app, event)
y=rand(1,5);
plot(app.UIAxes,y)
end
and the result in my app.
Tab 1
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/841715/image.png)
Tab 2
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/841720/image.png)
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!