How can I extract just the "real" axes from figures? Filtering out handles to annotation and legend.

2 ビュー (過去 30 日間)
Here is a scenario. You have a large number of figures open. Say each figure has a "main" axes showing some line plots, and also some "other" axes, like a legend, annotation, etc. So
figs=get(0,'children');
axss=get(figs,'children');
returns a vector of cell arrays. axss{k} contains all the children of figs(k), only one of which is the "main" axis you need to work with. So what is the best way to filter out the rest? Looking at
get(axss{k},'type')
you may find that many of the objects have type axes. Is there a quick way to distinguish what is not annotation?

採用された回答

Walter Roberson
Walter Roberson 2012 年 1 月 31 日
I cannot test at the moment, but my recollection is that legend and annotation axes are given Tag values that indicate what they are.
Something similar to,
findobj(0, 'type', 'axes', '-not', 'Tag', '__Annotation__', '-and', '-not', 'Tag', '__Legend__')
  1 件のコメント
Naor Movshovitz
Naor Movshovitz 2012 年 1 月 31 日
Ah, that is a good place to start. Fortunately for me, the data containing axes were probably not tagged at all so it's even easier.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by