clear all axes handles in GUI

6 ビュー (過去 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'))
  1 件のコメント
Ayesha Abbasi
Ayesha Abbasi 2018 年 7 月 17 日
this works (y) .

サインインしてコメントする。

その他の回答 (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 Center および File ExchangeAnnotations についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by