How can I delete an axes handle from a GUI?

9 ビュー (過去 30 日間)
Flávio
Flávio 2013 年 3 月 24 日
So let me explain better. I have axes1 in my GUI and I have used 'scatter' to draw something in axes1. Now I want to remove the image and make axes1 non visible.
I tried to use set(handles.axes1,'Visible','Off') but this only makes axes not visible leaving there the scatter image.
I have also tried delete(handles.axes1) but this removes completely the handles from my GUI and I don't want that because the user may want to scatter a new graphic.
Sorry for my bad English and I hope I made myself clear...
Thanks!

採用された回答

Image Analyst
Image Analyst 2013 年 3 月 24 日
編集済み: Image Analyst 2013 年 3 月 24 日
Unfortunately MATLAB is not like Microsoft Visual Studio in that regard. Setting the axes to invisible doesn't really hide the whole thing. Possibly the easiest way to do that is to place the axes inside a panel. Then you can set the panel visibility on or off and it will show or hide everything inside of it. Using cla() and it's various options will not hide the whole thing - you'll still have stuff showing. Hope that helps.
  4 件のコメント
Flávio
Flávio 2013 年 3 月 24 日
Thanks man! I will try it ;)
Flávio
Flávio 2013 年 3 月 24 日
It's done. With legend I only wrote legend(handles.axes1,'off'). With colorbar I did like you said using findobj and it worked. Thanks ;)

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

その他の回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 24 日
add
cla(handles.axes1)

カテゴリ

Help Center および File ExchangeSpecifying 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