rectangle invisible in matlab

2 次查看(过去 30 天)
Alan
Alan2021-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 个评论
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');

Community Treasure Hunt

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

Start Hunting!

Translated by