is an option for Tree and related functions that specifies the maximum number of children that should be displayed for each subtree.


MaxDisplayedChildren
is an option for Tree and related functions that specifies the maximum number of children that should be displayed for each subtree.
Details

- MaxDisplayedChildren allows the children of the root node of a tree to be elided, as well as those of any subtrees at positions matching a pattern.
- The following option settings can be used:
-
Automatic display the default number of children m display m children for the node » Allm display m children for all nodes » TreeCases[pattern]m display m children for nodes with data matching pattern » {pos1m1,pos2m2,…} display mi children for the node at relative position posi » {patt1m1,patt2m2,…} display mi children for nodes at positions matching patti » - The global variable $MaxDisplayedChildren gives the default number of children for all nodes.
Examples
open all close allBasic Examples (3)
Properties & Relations (6)
Ten children are displayed by default:
Setting $MaxDisplayedChildren=m specifies the default number of children to display for the option setting MaxDisplayedChildrenAutomatic:
Restore $MaxDisplayedChildren to its default:
Maximum children for nodes can be specified by position:
Specify the maximum number of children for a tree:
Maximum children specified by a subtree take precedence over those specified by its ancestors:
A position {i,j,…} in a subtree refers to its subtree at relative position {i,j,…}:
A relative position {2} at position {1} refers to the global position {1,2}:
In general, a pattern patt applies to subtrees at global positions {i,j,…} that match patt:
A list of patterns {patt1,patt2,…} applies to relative positions {i,j,…} that match the patti:
Related Guides
History
Text
Wolfram Research (2022), MaxDisplayedChildren, Wolfram Language function, https://reference.wolfram.com/language/ref/MaxDisplayedChildren.html.
CMS
Wolfram Language. 2022. "MaxDisplayedChildren." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MaxDisplayedChildren.html.
APA
Wolfram Language. (2022). MaxDisplayedChildren. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MaxDisplayedChildren.html
BibTeX
@misc{reference.wolfram_2025_maxdisplayedchildren, author="Wolfram Research", title="{MaxDisplayedChildren}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/MaxDisplayedChildren.html}", note=[Accessed: 11-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_maxdisplayedchildren, organization={Wolfram Research}, title={MaxDisplayedChildren}, year={2022}, url={https://reference.wolfram.com/language/ref/MaxDisplayedChildren.html}, note=[Accessed: 11-August-2025]}