Mercurial > repos > shellac > sam_consensus_v3
comparison 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 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:4f3585e2f14b |
|---|---|
| 1 """ | |
| 2 ============= | |
| 3 Circular Tree | |
| 4 ============= | |
| 5 """ | |
| 6 | |
| 7 import matplotlib.pyplot as plt | |
| 8 import networkx as nx | |
| 9 | |
| 10 # This example needs Graphviz and either PyGraphviz or pydot | |
| 11 # from networkx.drawing.nx_pydot import graphviz_layout | |
| 12 from networkx.drawing.nx_agraph import graphviz_layout | |
| 13 | |
| 14 | |
| 15 G = nx.balanced_tree(3, 5) | |
| 16 pos = graphviz_layout(G, prog="twopi", args="") | |
| 17 plt.figure(figsize=(8, 8)) | |
| 18 nx.draw(G, pos, node_size=20, alpha=0.5, node_color="blue", with_labels=False) | |
| 19 plt.axis("equal") | |
| 20 plt.show() |
