TreeElementLabel

TreeElementLabel

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

Details

  • TreeElementLabel allows specifying the label of the root node of a tree, as well as that of any subtrees at positions matching a pattern.
  • The following option settings can be used:
  • Noneuse no label
    Automaticuse the subtree data as the label
    lbllabel the subtree element with lbl
    {pos1lbl1,pos2lbl2,}label the subtree element at position posi with lbli
    {patt1lbl1,patt2lbl2,}label subtree elements at positions matching patti with lbli
  • Any expression can be used as a label.
  • In TreeElementLabel, Alllbl uses lbl for all subtrees.

Examples

open allclose all

Basic Examples  (4)

Label an individual subtree element:

Label all subtree elements:

Use no labels:

Specify positions using patterns:

Properties & Relations  (5)

Subtree elements are automatically labeled with the data of that subtree:

Labels for subtree elements can be specified by position:

Labels specified by a subtree take precedence over labels 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 (13), TreeElementLabel, Wolfram Language function, https://reference.wolfram.com/language/ref/TreeElementLabel.html.

Text

Wolfram Research (13), TreeElementLabel, Wolfram Language function, https://reference.wolfram.com/language/ref/TreeElementLabel.html.

CMS

Wolfram Language. 13. "TreeElementLabel." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TreeElementLabel.html.

APA

Wolfram Language. (13). TreeElementLabel. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TreeElementLabel.html

BibTeX

@misc{reference.wolfram_2021_treeelementlabel, author="Wolfram Research", title="{TreeElementLabel}", year="13", howpublished="\url{https://reference.wolfram.com/language/ref/TreeElementLabel.html}", note=[Accessed: 24-January-2022 ]}

BibLaTeX

@online{reference.wolfram_2021_treeelementlabel, organization={Wolfram Research}, title={TreeElementLabel}, year={13}, url={https://reference.wolfram.com/language/ref/TreeElementLabel.html}, note=[Accessed: 24-January-2022 ]}