Mercurial > repos > shellac > sam_consensus_v3
diff env/share/doc/networkx-2.5/examples/drawing/plot_circular_tree.py @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author | shellac |
---|---|
date | Mon, 22 Mar 2021 18:12:50 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/env/share/doc/networkx-2.5/examples/drawing/plot_circular_tree.py Mon Mar 22 18:12:50 2021 +0000 @@ -0,0 +1,20 @@ +""" +============= +Circular Tree +============= +""" + +import matplotlib.pyplot as plt +import networkx as nx + +# This example needs Graphviz and either PyGraphviz or pydot +# from networkx.drawing.nx_pydot import graphviz_layout +from networkx.drawing.nx_agraph import graphviz_layout + + +G = nx.balanced_tree(3, 5) +pos = 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()