TreeForm
TreeForm[expr]
displays expr as a tree with different levels at different depths.
TreeForm[expr,n]
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 expressions 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. »
-
AlignmentPoint Center the default point in the graphic to align with AspectRatio Automatic ratio of height to width Axes False whether to draw axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool DataRange Automatic the range of vertex coordinates to generate DirectedEdges False whether to interpret Rule as DirectedEdge EdgeLabels None labels and placements for edges EdgeLabelStyle Automatic style to use for edge labels EdgeShapeFunction Automatic generate graphic shapes for edges EdgeStyle Automatic styles for edges Epilog {} primitives rendered after the main plot FormatType TraditionalForm the default format type for text Frame False whether to put a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks Automatic frame ticks FrameTicksStyle {} style specifications for frame ticks GraphHighlight {} vertices and edges to highlight GraphHighlightStyle Automatic style for highlight GridLines None grid lines to draw GridLinesStyle {} style specifications for grid lines ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels etc. ImageSize Automatic the absolute size at which to render the graphic LabelStyle {} style specifications for labels LayerSizeFunction (1) the height to allow for each layer Method Automatic details of graphics methods to use PerformanceGoal Automatic aspects of performance to try to optimize PlotLabel None an overall label for the plot PlotRange All range of values to include PlotRangeClipping False whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic the final display region to be filled PlotStyle Automatic graphics directives to determine styles PlotTheme Automatic overall theme for the graph PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RotateLabel True whether to rotate y labels on the frame Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks VertexCoordinates Automatic coordinates for vertices VertexLabels None labels and placements for vertices VertexLabelStyle Automatic style to use for vertex labels VertexShape Automatic graphic shape for vertices VertexShapeFunction Automatic generate graphic shapes for vertices VertexSize Automatic size of vertices VertexStyle Automatic styles for vertices
List of all options
Examples
open allclose allBasic Examples (3)
Scope (9)
Options (14)
AspectRatio (2)
PlotRangePadding (1)
Use different PlotRangePadding around the drawing:
PlotStyle (3)
Specify an overall style for the drawing:
PlotStyle can be combined with VertexRenderingFunction, which has higher priority:
PlotStyle can be combined with EdgeRenderingFunction, which has higher priority:
Properties & Relations (6)
FullForm gives a linear expression similar to TreeForm:
OutputForm of TreeForm gives a textual display of the expression:
Use TreePlot to plot a tree graph:
Use GraphPlot or GraphPlot3D for general undirected graphs:
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:
Copy the output and paste it into an input cell. The is interpreted as x2:
When an input evaluates to TreeForm[expr], TreeForm does not appear in the output:
Possible Issues (2)
Compound heads are not laid out as trees:
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:
Text
Wolfram Research (1988), TreeForm, Wolfram Language function, https://reference.wolfram.com/language/ref/TreeForm.html (updated 2007).
CMS
Wolfram Language. 1988. "TreeForm." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/TreeForm.html.
APA
Wolfram Language. (1988). TreeForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TreeForm.html