Display two figures in two different axis using matlab gui
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Elena Martín
le 4 Mar 2019
Réponse apportée : Kevin Phung
le 4 Mar 2019
Hi everyone,
I'm having some trouble using two axis in the same matlab gui, I attach my code so the question is clear: the thing is when a button is pushed the function Electrodes_Brain returns a figure which i need to set to an axis. I have two axis and two buttons so I expect to get one figure in each axis but that doesn´t happen, when a second button is pushed the figure is set to the same axis. I'm also attaching a screenshot of the result I obtain. If someone knows what the problem is please let me know. Thanks!
0 commentaires
Réponse acceptée
Kevin Phung
le 4 Mar 2019
what you can do is assign a tag to your axes when you create them, and point back to them in your callback functions.
here's an example:
a = axes;
a.Tag = 'ax1';
b=axes;
b.Tag = 'ax2'
Now, within your callback:
a= findobj(gcf,'Tag','ax1');
b = findobj(gcf,'Tag','ax2');
plot(a,x,y)
plot(b,x2,y2)
if your axes are in the same function as your callback function, you dont need to assign any tags or look for them, just pass the handle as the first argument
plot(a,x,y)
plot(b,x2,y2)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!