displays expr as a tree with different levels at different depths.
displays expr as a tree only down to level n.
Details and Options
- With a notebook front end, TreeForm displays as a graphical tree in StandardForm and TraditionalForm.
- TreeForm takes the same options as TreePlot.
- VertexLabeling->Automatic does not display expression fragments at each node, but still gives subtree expression as tooltips.
- VertexLabeling->False does not give expression fragments or tooltips.
- The typeset form of TreeForm[expr] is interpreted the same as expr when used in input. »
- When an input evaluates to TreeForm[expr], TreeForm does not appear in the output. »
Examplesopen allclose all
Basic Examples (3)
A formatted expression with a special superscript and OverBar:
A Series expression:
An expression containing Hold:
Use different PlotRangePadding around the drawing:
Properties & Relations (6)
Use TreePlot to plot a tree graph:
Use LayeredGraphPlot for hierarchical-style drawing of directed graphs:
The typeset form of TreeForm[expr] is interpreted the same as expr when used in input:
Possible Issues (2)
Even when an output omits TreeForm from the top level, it is not stripped from subexpressions:
The output does not have TreeForm in it:
However, the variable e does have TreeForm in it, which may affect subsequent evaluations:
The product is not evaluated due to the intervening TreeForm:
Assign variables first and then apply TreeForm to the result to maintain computability:
Wolfram Research (1988), TreeForm, Wolfram Language function, https://reference.wolfram.com/language/ref/TreeForm.html (updated 2007).
Wolfram Language. 1988. "TreeForm." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/TreeForm.html.
Wolfram Language. (1988). TreeForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TreeForm.html