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


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

- 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:
-
Automatic use the automatic shape g use the graphic g for the node » Allg use g for all nodes » TreeCases[pattern]g use g for nodes with data matching pattern » "Leaves"g use g for leaves » "NonLeaves"g use g for non-leaves » {pos1g1,pos2g2,…} use gi for the node at relative position posi » {patt1g1,patt2g2,…} use gi for nodes at positions matching patti » - TreeElementShapeFunction specifications override TreeElementShape specifications. »
Examples
open all close allBasic Examples (4)
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 nodes 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:
Possible Issues (1)
TreeElementShape takes graphics or images used for nodes:
TreeElementShapeFunction requires Inset to render graphics or an image:
Related Guides
History
Text
Wolfram Research (2022), TreeElementShape, Wolfram Language function, https://reference.wolfram.com/language/ref/TreeElementShape.html.
CMS
Wolfram Language. 2022. "TreeElementShape." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TreeElementShape.html.
APA
Wolfram Language. (2022). TreeElementShape. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TreeElementShape.html
BibTeX
@misc{reference.wolfram_2025_treeelementshape, author="Wolfram Research", title="{TreeElementShape}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/TreeElementShape.html}", note=[Accessed: 15-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_treeelementshape, organization={Wolfram Research}, title={TreeElementShape}, year={2022}, url={https://reference.wolfram.com/language/ref/TreeElementShape.html}, note=[Accessed: 15-August-2025]}