blob: 24893a8732bf3b6fcc70330e2f78c904050f937d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
"""
=============
Circular Tree
=============
This example needs Graphviz and PyGraphviz.
"""
import matplotlib.pyplot as plt
import networkx as nx
G = nx.balanced_tree(3, 5)
pos = nx.nx_agraph.graphviz_layout(G, prog="twopi", args="")
plt.figure(figsize=(8, 8))
nx.draw(G, pos, node_size=20, alpha=0.5, node_color="blue", with_labels=False)
plt.axis("equal")
plt.show()
|