allchild

Returns all children of graphics objects, including hidden ones.

Category: Graphics > Graphics Objects

Syntax

c = allchild(h)

Returns the children of h; for several handles, a cell array with one entry each.

Description

Unlike reading the Children property, allchild also lists objects whose HandleVisibility is off. It is the dependable way to inspect what an axes or figure really contains. The newest object comes first.

Input arguments

h
Handle or array of handles to figures, axes or other containers.

Output arguments

c
Column array of child handles (a cell array for multiple parents).

Example

Children of an axes

figure
ax = axes;
h = plot(1:3);
c = allchild(ax);
disp(numel(c))
disp(c == h)
Output
     1
   1

See also

findobj findall ancestor gca delete