필터 지우기
필터 지우기

determining number of axes on a figure

조회 수: 12 (최근 30일)
Art
Art 2012년 4월 10일
댓글: Massimo Ciacci 2021년 11월 16일
how can I determine the number of axes that a figure has?
using get(figure,'Children') works but also gives data on non-axis children, which I don't want

답변 (2개)

Walter Roberson
Walter Roberson 2012년 4월 10일
Do you only want axes that are immediate children, or do you want all axes, even those that might be several objects down (such as within uipanel) ? And how about if the handles are hidden, do you want them returned or not?
Immediate children only:
findobj( get(gcf,'Children'), '-depth', 1, 'type', 'axes')
All children (including hidden) at all levels:
findall(gcf, 'type', 'axes')
  댓글 수: 5
Art
Art 2012년 4월 11일
that works - thanks
Massimo Ciacci
Massimo Ciacci 2021년 11월 16일
Awesome tip, didn't know about '-depth'. Works a charm.

댓글을 달려면 로그인하십시오.


Daniel Shub
Daniel Shub 2012년 4월 10일
findobj(gcf, 'type', 'axes')

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by