ancestor
Ancestor of graphics object.
📝Syntax
p = ancestor(h, type)
p = ancestor(h, type, 'toplevel')
📥Input Arguments
Parameter Description
h graphics object
type a row vector character or cell of strings:
'toplevel' a row vector character: return the highest parent in the object hierarchy that matches the condition.
📤Output Arguments
Parameter Description
p a graphics object or []
📄Description

ancestor returns the handle of the specified object's ancestor of a given type.

💡Examples
f = figure();
ax = gca();
s = surf(peaks);
AX = ancestor(s, 'axes')
F = ancestor(s, 'figure')
R = ancestor(s, 'root')
🔗See Also
gcf
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub