rectangle invisible in matlab

7 visualizaciones (últimos 30 días)
Alan
Alan el 18 de Ag. de 2021
Comentada: Alan el 18 de Ag. de 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.

Respuesta aceptada

Turlough Hughes
Turlough Hughes el 18 de Ag. de 2021
The following works for me:
roi.Visible = 'off';
  2 comentarios
Turlough Hughes
Turlough Hughes el 18 de Ag. de 2021
similarly, you can use the object (already assigned to roi) with the set function as follows:
set(roi,'Visible','off')
Alan
Alan el 18 de Ag. de 2021
Thanks for your answer. It works well.

Iniciar sesión para comentar.

Más respuestas (1)

Yongjian Feng
Yongjian Feng el 18 de Ag. de 2021
Try this:
H = findobj('Type', 'images.roi.rectangle');

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by