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

Examples

open allclose all

Basic Examples  (3)

A symbolic expression formatted as a tree:

In[1]:=
Click for copyable input
Out[1]//TreeForm=

Show the tree form for the first two levels in the expression:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]//TreeForm=

A graphics expression formatted as a tree:

In[1]:=
Click for copyable input
Out[1]//TreeForm=

Scope  (9)

Options  (14)

Applications  (1)

Properties & Relations  (4)

Possible Issues  (1)

Neat Examples  (2)

See Also

FullForm  MatrixForm  TreePlot  Graph

Tutorials

Introduced in 1988
(1.0)
| Updated in 2007
(6.0)