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 OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples (3)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=
New in 1 | Last modified in 6
New to Mathematica? Find your learning path »
Have a question? Ask support »