MATLAB Answers

rectangle invisible in matlab

6 views (last 30 days)
Alan
Alan on 18 Aug 2021
Commented: Alan on 18 Aug 2021
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.

Accepted Answer

Turlough Hughes
Turlough Hughes on 18 Aug 2021
The following works for me:
roi.Visible = 'off';
  2 Comments
Alan
Alan on 18 Aug 2021
Thanks for your answer. It works well.

Sign in to comment.

More Answers (1)

Yongjian Feng
Yongjian Feng on 18 Aug 2021
Try this:
H = findobj('Type', 'images.roi.rectangle');
  1 Comment
Alan
Alan on 18 Aug 2021
Thanks for your answer.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!