is an option for Tree and related functions that specifies what graphics should be used for subtree elements.


  • TreeElementShape allows specifying the shape of the root node of a tree, as well as that of any subtree at positions matching a pattern.
  • TreeElementShape can be any Graphics, Graphics3D or Image object.
  • The center of the object lies at the position in the graphic specified by TreeElementCoordinates. »
  • The rendered form of each subtree element is obtained by rescaling the given object as specified by TreeElementSize. »
  • The following option settings can be used:
  • Automaticuse the automatic setting for a shape
    guse the graphic g for the subtree element
    {pos1g1,pos2g2,}use gi for the subtree element at relative position posi
    {patt1g1,patt2g2,}use gi for the subtree elements at positions matching the pattern patti
  • TreeElementShapeFunction specifications override TreeElementShape specifications. »
  • In TreeElementShape, Allg uses g for all subtrees.
  • In TreeElementShape, TreeCases[pattern]g uses g for all subtrees with data matching pattern.


open allclose all

Basic Examples  (4)

Specify an individual subtree element shape:

Specify all subtree element shapes:

Use the same shape for all subtree elements:

Specify positions using position patterns:

Specify positions using data patterns:

Properties & Relations  (7)

The center of the object lies at the position in the graphic specified by TreeElementCoordinates:

TreeElementShape can be combined with TreeElementSize:

TreeElementShapeFunction specifications override TreeElementShape specifications:

Shapes for subtree elements can be specified by position:

Styles specified by a subtree take precedence over styles 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:

Wolfram Research (2022), TreeElementShape, Wolfram Language function,


Wolfram Research (2022), TreeElementShape, Wolfram Language function,


Wolfram Language. 2022. "TreeElementShape." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2022). TreeElementShape. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_treeelementshape, author="Wolfram Research", title="{TreeElementShape}", year="2022", howpublished="\url{}", note=[Accessed: 25-July-2024 ]}


@online{reference.wolfram_2024_treeelementshape, organization={Wolfram Research}, title={TreeElementShape}, year={2022}, url={}, note=[Accessed: 25-July-2024 ]}