Azzera filtri
Azzera filtri

Display two figures in two different axis using matlab gui

10 visualizzazioni (ultimi 30 giorni)
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!Captura.JPG

Risposta accettata

Kevin Phung
Kevin Phung il 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)

Più risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps 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!

Translated by