Accessing the annotation handle

Hi, I am creating a 2d plot and inserting a textarrow using the figure window 'drop down' menu options. Later I wanted to access the handle of the textarrow thus created, so that I can get the positions, strings etc related to the textarrow. So my question is how can access the textarrow handle (the textarrow being created MANUALLY through gui options. Thanks Samik

 Respuesta aceptada

Geoff Hayes
Geoff Hayes el 22 de Dic. de 2014
Samik - it seems that annotation objects (like the one that you have describe above) are children of a hidden axes named scribeOverlay. So you can try using the findall command to find this axes, and so the child annotation object. In R2014a, I created a figure and (like you) added a text arrow via the menu. In the Command Window (or your script or function), type
% get the handle of the hidden annotation axes
hAnnotAxes = findall(gcf,'Tag','scribeOverlay');
% get its children handles
if ~isempty(hAnnotAxes)
hAnnotChildren = get(hAnnotAxes,'Children');
% do something with the annotation handles...
end
Try the above and see what happens!

4 comentarios

samik
samik el 22 de Dic. de 2014
Thanks a lot Geoff, appreciate your help, saved me from a lot of trouble.
Geoff Hayes
Geoff Hayes el 22 de Dic. de 2014
Glad it worked out!
Geoff Hayes
Geoff Hayes el 27 de Sept. de 2017
Max Bernstein's question moved here
I was able to find the annotation but how can I move it in a figure from left to right (for example)? Or how can I move the annotation in a existing figure?
Geoff Hayes
Geoff Hayes el 27 de Sept. de 2017
Max - what properties do you see for the annotation object?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 22 de Dic. de 2014

Comentada:

el 27 de Sept. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by