필터 지우기
필터 지우기

Close Subplot in GUI

조회 수: 6 (최근 30일)
ken kin
ken kin 2011년 5월 25일
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
ken kin
ken kin 2011년 5월 25일
Sorry, I means 'subplot' as an axes.
So, how can I close one or more Axes in GUI but not the figure. Then, I want to delete also all the variables on the previous axes and change it with the new one
^_^

댓글을 달려면 로그인하십시오.

답변 (2개)

Jan
Jan 2011년 5월 25일
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
ken kin
ken kin 2011년 5월 25일
ups,,
I means the subplot condition in GUI...
It's enough on finding the way (or syntax) to close the axes.
Mm,, 'restart the function' just refers to call my looping script that will be access when I press the button.
It just need to clear the previous axes (and its variables) to change the graph with the new one.
Ok. I'll try it ^_^ Thanks Jan

댓글을 달려면 로그인하십시오.


Gaëlle
Gaëlle 2013년 7월 4일
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
Jan
Jan 2013년 7월 5일
@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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by