Close Subplot in GUI
Mostrar comentarios más antiguos
How can I close one or more subplot in GUI but not the figure? I need it to clear the subplot's variables and restart the function...
1 comentario
ken kin
el 25 de Mayo de 2011
Respuestas (2)
Jan
el 25 de Mayo de 2011
SUBPLOT replies a handle to the created AXES object. If you store these handles, DELETE can clear a single AXES:
AxesH = zeros(1, 4); % Always pre-allocate!
for i = 1:4
AxesH(i) = subplot(2, 2, i);
end
pause(2);
delete(AxesH(2))
You do not offer enough information for any suggestion about "restart the function".
1 comentario
ken kin
el 25 de Mayo de 2011
Gaëlle
el 4 de Jul. de 2013
0 votos
Hi, I am also trying to delete a subplot from a figure. I have set a global variable axhandle, which takes the output of the subplot, e.g. axhandle(i)=subplot('Position',mymatrixofposition(i,:))
However, I receive the following error while trying to delete the subplot, using delete(axhandle(i)): Root object may not be deleted
Do you know where this error come from?
Thank you, Gaelle
1 comentario
Jan
el 5 de Jul. de 2013
@Gaëlle: Please do not append a new question as an answer to an existing thread. Notice that such thread-highjacking does not allow you to accepnt an answer, which solves the problem, and it is not clear anymore, to which question the other answers belong to.
So please delete this message and post a new question. Thanks.
Categorías
Más información sobre Subplots en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!