rectangle invisible in matlab

6 ビュー (過去 30 日間)
Alan
Alan 2021 年 8 月 18 日
コメント済み: Alan 2021 年 8 月 18 日
Hi all,
I draw a rectangular in a figure by the code,
roi = drawrectangle('color','r','linewidth',2);
And now I want to set the rectangular invisible, so I code like this:
H = findobj(handles, 'type','rectangle');
set(H,'visible','off');
But this code does not work at all.
Could anyone help me to figure it out?
Thanks so much.

採用された回答

Turlough Hughes
Turlough Hughes 2021 年 8 月 18 日
The following works for me:
roi.Visible = 'off';
  2 件のコメント
Turlough Hughes
Turlough Hughes 2021 年 8 月 18 日
similarly, you can use the object (already assigned to roi) with the set function as follows:
set(roi,'Visible','off')
Alan
Alan 2021 年 8 月 18 日
Thanks for your answer. It works well.

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

その他の回答 (1 件)

Yongjian Feng
Yongjian Feng 2021 年 8 月 18 日
Try this:
H = findobj('Type', 'images.roi.rectangle');
  1 件のコメント
Alan
Alan 2021 年 8 月 18 日
Thanks for your answer.

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

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by