TreePlot

TreePlot[g]

generates a tree plot of the graph g.

TreePlot[{vi 1vj 1,vi 2vj 2,}]

generates a tree plot of the graph in which vertex vik is connected to vertex vjk.

TreePlot[{{vi 1vj 1,lbl1},}]

associates labels lblk with edges in the graph.

TreePlot[g,pos]

places roots of trees in the plot at position pos.

TreePlot[g,pos,vk]

uses vertex vk as the root node in the tree plot.

Details and Options

Examples

open allclose all

Basic Examples  (7)

Draw a tree:

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

Show direction of edges:

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

Include vertex labels:

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

Show edge labels:

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

Drawing a tree with different orientation from the default:

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

Specify the root node:

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

If the graph is not a tree, it is laid out based on a spanning tree of this graph:

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

Scope  (11)

Options  (26)

Applications  (8)

Properties & Relations  (3)

Possible Issues  (2)

Neat Examples  (1)

See Also

Graph  LayeredGraphPlot  GraphPlot  TreeForm  Level  Dendrogram

Tutorials

Introduced in 2007
(6.0)
| Updated in 2014
(10.0)