creating annotation, cannot find it on the figure in code

6 ビュー (過去 30 日間)
Chris DeVries
Chris DeVries 2011 年 8 月 23 日
I am creating an annotation on a figure with a function. When I re-enter the function, I cannot find the annotation object within the figure.
I checked and the annotations parent is an axes whose parent is the figure, but when I look at the figure's children, it only lists the main axes (not the one containing the annotation). Even FindObj doesn't find the axes that the annotation is on (I've tried findObj('Type','axes') and only one answer comes up).
Any ideas?
  1 件のコメント
Oleg Komarov
Oleg Komarov 2011 年 8 月 23 日
Annotation is a figure child not axes'

サインインしてコメントする。

採用された回答

Jan
Jan 2011 年 8 月 23 日
Please post the commands you are using to create and to search the annotation. E.g.:
figure;
H = annotation('textbox', [0.5, 0.5, 0.2, 0.2]);
get(H, 'Type')
% >> hggroup
get(get(H, 'Children'), 'Type')
% >> axes
any(allchild(gcf), get(H, 'Children')
% >> 1
You need the ALLCHILD, because the annotation has a hidden handle.
  1 件のコメント
Chris DeVries
Chris DeVries 2011 年 8 月 23 日
That did it. Thanks! It had a hidden handle.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by