Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (13 sloc) 453 Bytes
import networkx as nx
import matplotlib.pyplot as plt
try:
from networkx import graphviz_layout
except ImportError:
raise ImportError("This example needs Graphviz and either PyGraphviz or Pydot")
G=nx.balanced_tree(2,5)
pos=nx.graphviz_layout(G,prog='dot',args='')
plt.figure(figsize=(8,8))
nx.draw(G,pos,node_size=40,alpha=0.2,node_color="blue", with_labels=False)
plt.axis('equal')
plt.savefig('circular_tree.png')
plt.show()
You can’t perform that action at this time.