フィルターのクリア

How to make UIAXES invisible after imshow?

7 ビュー (過去 30 日間)
ILoveMATLAB
ILoveMATLAB 2019 年 2 月 2 日
コメント済み: ILoveMATLAB 2019 年 2 月 12 日
I used imshow to display an image in an UIAXES object. After displaying the image, I would like to temporarily hide the axes and image. Setting the visibility of the uiaxis to off doesn't hide the uiaxis. The image is still visible, and I can still interact with the uiaxis. How do i make the uiaxis invisible? Is this a bug?
app.exAxes.Visible = 'off';
I am using 2018b update 2.

採用された回答

Walter Roberson
Walter Roberson 2019 年 2 月 2 日
Not a bug.
Unlike all of the other objects I can think of at the moment, when you set an axes Visible to off, what you are controlling is the outside decorations such as the plot box, the tick marks, the title and labels, the grid -- but not any of the things drawn in the axes. There is no control at the axes level to say "make this axes and all of its contents invisible".
There are two work-arounds for standard axes:
  1. Put the axes inside a container object such as a uipanel. When you set the container visibility to off, the graph will disappear as well. This has the advantage that you can control everything about the labels etc. and the graphics at the same time; Or
  2. Create a hggroup inside the axes, and parent the graphics objects to the hggroup. When you set the hggroup visibility to off, the graphcis will disappear. This does not affect the labels etc. so if you want those invisible you would have to set the axes visibility off as well.
  4 件のコメント
ILoveMATLAB
ILoveMATLAB 2019 年 2 月 5 日
I will try this when I get a chance. I eliminated the pause by just calculating what the panel's new position would be prior to stretching the panel.
ILoveMATLAB
ILoveMATLAB 2019 年 2 月 12 日
drawnow works.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by