WOLFRAM

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:
  • Automaticdisplay the default number of children
    mdisplay m children for the node »
    Allmdisplay m children for all nodes »
    TreeCases[pattern]mdisplay 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 all

Basic Examples  (3)Summary of the most common use cases

Display all children of the root node:

Out[3]=3

Display five children:

Out[1]=1

Display two children for all nodes:

Out[1]=1

Specify a list of max child numbers:

Out[1]=1

Scope  (2)Survey of the scope of standard use cases

Specify positions using position patterns:

Out[6]=6

Specify positions using data patterns:

Out[1]=1

Properties & Relations  (6)Properties of the function, and connections to other functions

Ten children are displayed by default:

Out[1]=1
Out[2]=2

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

Out[1]=1
Out[2]=2

Restore $MaxDisplayedChildren to its default:

Maximum children for nodes can be specified by position:

Out[1]=1

Specify the maximum number of children for a tree:

Out[1]=1

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

Out[2]=2

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

Out[1]=1

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

Out[2]=2

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

Out[1]=1

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

Out[2]=2
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.

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 ]}

@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 ]}

@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 ]}