MaxDisplayedChildren
✖
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 allclose allBasic Examples (3)Summary of the most common use cases
Display all children of the root node:

https://wolfram.com/xid/08ufeaf3lcb9yy6-z8b82g


https://wolfram.com/xid/08ufeaf3lcb9yy6-mh7wkk

Display two children for all nodes:

https://wolfram.com/xid/08ufeaf3lcb9yy6-hg2j9a

Specify a list of max child numbers:

https://wolfram.com/xid/08ufeaf3lcb9yy6-csslaf

Scope (2)Survey of the scope of standard use cases
Properties & Relations (6)Properties of the function, and connections to other functions
Ten children are displayed by default:

https://wolfram.com/xid/08ufeaf3lcb9yy6-6ujmlz


https://wolfram.com/xid/08ufeaf3lcb9yy6-h7bjr2

Setting $MaxDisplayedChildren=m specifies the default number of children to display for the option setting MaxDisplayedChildrenAutomatic:

https://wolfram.com/xid/08ufeaf3lcb9yy6-pkqs90


https://wolfram.com/xid/08ufeaf3lcb9yy6-lsyula

Restore $MaxDisplayedChildren to its default:

https://wolfram.com/xid/08ufeaf3lcb9yy6-jdbo4p
Maximum children for nodes can be specified by position:

https://wolfram.com/xid/08ufeaf3lcb9yy6-rzu1f0

Specify the maximum number of children for a tree:

https://wolfram.com/xid/08ufeaf3lcb9yy6-5411c0

Maximum children specified by a subtree take precedence over those specified by its ancestors:

https://wolfram.com/xid/08ufeaf3lcb9yy6-0ghtad

A position {i,j,…} in a subtree refers to its subtree at relative position {i,j,…}:

https://wolfram.com/xid/08ufeaf3lcb9yy6-i5nn9b

A relative position {2} at position {1} refers to the global position {1,2}:

https://wolfram.com/xid/08ufeaf3lcb9yy6-djnkdj

In general, a pattern patt applies to subtrees at global positions {i,j,…} that match patt:

https://wolfram.com/xid/08ufeaf3lcb9yy6-ym39qo

A list of patterns {patt1,patt2,…} applies to relative positions {i,j,…} that match the patti:

https://wolfram.com/xid/08ufeaf3lcb9yy6-imuot7

Wolfram Research (2022), MaxDisplayedChildren, Wolfram Language function, https://reference.wolfram.com/language/ref/MaxDisplayedChildren.html.
Text
Wolfram Research (2022), MaxDisplayedChildren, Wolfram Language function, https://reference.wolfram.com/language/ref/MaxDisplayedChildren.html.
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.
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
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: 10-July-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: 10-July-2025
]}