How do I delete all annotations on a figure but not do clf?

How do I delete all annotations on a Figure? I do not want to do "clf" since that loses attributes that I want to keep. Doing "cla" does not remove the annotations.

 Respuesta aceptada

Ritesh Chandna
Ritesh Chandna el 10 de Abr. de 2017
Please use the below command to delete all the annotations on a figure:
>>delete(findall(gcf,'type','annotation'))

2 comentarios

Thank you. Readable, works, and simpler than any other method I found.
worked thanks

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Printing and Saving en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 7 de Abr. de 2017

Comentada:

el 26 de Feb. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by