Display two figures in two different axis using matlab gui
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Elena Martín
el 4 de Mzo. de 2019
Respondida: Kevin Phung
el 4 de Mzo. de 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 comentarios
Respuesta aceptada
Kevin Phung
el 4 de Mzo. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!