필터 지우기
필터 지우기

clear all axes handles in GUI

조회 수: 7 (최근 30일)
Christof
Christof 2011년 6월 29일
댓글: Ayesha Abbasi 2018년 7월 17일
I have a GUI that plots 4 axes in a GUI and I would like to clear those with a button. Tried cla(findall(0,'type','axes')) but it does not do anything. what is wrong with this command?

채택된 답변

Paulo Silva
Paulo Silva 2011년 6월 29일
arrayfun(@cla,findall(0,'type','axes'))

추가 답변 (3개)

Gerd
Gerd 2011년 6월 29일
Hi Christof,
I think your code should work. Please make sure you are using the right figure handle.
Gerd
  댓글 수: 3
Gerd
Gerd 2011년 6월 29일
cla clears all the children from an axes. And I assume this is what he is talking about, because nothing is happining. You can even use just cla and it should work for one single axes with multiple plots on. If he has the wrong current figure nothing will happen.
Paulo Silva
Paulo Silva 2011년 6월 29일
Gerd please read the question again, Christof got 4 axes and he wants to clear them all, his code finds all the axes objects but fails because cla just clears the first axes returned by findall.

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


Christof
Christof 2011년 6월 29일
thanks for your help

norfaizayu
norfaizayu 2012년 1월 30일
when i use that source code, the picture in axes clear but the axes still there.how can i clear all that thing?picture in axes and axes all so that's mean will back to normal stage.

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by