ParentEdgeLabel
is an option for Tree and related functions that specifies what labels should be used for edges.
Details
- ParentEdgeLabel allows specifying the label of the parent edge 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:
-
Automatic use the keys of associations as the labels None use no label lbl label the edge with lbl Alllbl label all edges with lbl TreeCases[pattern]lbl label edges at nodes with data matching pattern with lbl {pos1lbl1,pos2lbl2,…} label the edge at position posi with lbli {patt1lbl1,patt2lbl2,…} label edges at positions matching patti with lbli - Any expression can be used as a label.
- Placed[lbl,p] can be used to place labels along an edge.
- The following placement specifications p can be used for Placed in positioning edge labels:
-
Tooltip,StatusArea show as tooltip or in status area on mouseover "Start","Middle","End" place label at start, middle or end {Left,p},{Right,p} place label left or right of the edge at symbolic position {s,{lx,ly}} scaled position {lx,ly} in the label at scaled position s along the edge - The scaled position along the edge curve represents the fraction of the total length: e.g. places the edge label at the halfway point.
- Edge label specifications are effectively applied in the order ParentEdgeLabel, ParentEdgeLabelFunction and ParentEdgeLabelStyle, with later specifications overriding earlier ones.
Examples
open allclose allScope (6)
Label Placement (5)
Use Placed with symbolic locations to control label placement along an edge:
Use explicit coordinates to place labels:
Place multiple labels using Placed:
Any number of labels can be used:
Use labeling through Tooltip and StatusArea:
Properties & Relations (5)
Edges are automatically labeled with the keys of an association of children:
No labels are used for a list of children:
Labels for edges 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:
Text
Wolfram Research (2022), ParentEdgeLabel, Wolfram Language function, https://reference.wolfram.com/language/ref/ParentEdgeLabel.html.
CMS
Wolfram Language. 2022. "ParentEdgeLabel." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ParentEdgeLabel.html.
APA
Wolfram Language. (2022). ParentEdgeLabel. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ParentEdgeLabel.html