arrow_style_lst = ['-', '->', '-[', '-|>', '<-', '<->', '<|-',
'<|-|>', ']-', ']-[', 'fancy', 'simple', 'wedge', '|-|']
f, axes = plt.subplots(7, 2)
f.set_size_inches((12, 16))
for i, arrow_style in enumerate(arrow_style_lst):
ax = axes[i//2][i%2]
DG = nx.DiGraph()
DG.add_nodes_from([ ("A{:0>2d}".format(i)) for i in range(0, 5)])
DG.add_edges_from([ ("A{:0>2d}".format(i), "A{:0>2d}".format(i+1)) for i in range(0, 4) ] )
pos = { n: (1.0/len(DG.nodes())*i, 0.5) for i, n in enumerate(DG.nodes())}
nx.draw_networkx_nodes(DG, pos=pos, node_size=500, node_color='blue', ax=ax)
nx.draw_networkx_edges(DG, pos=pos, width=3,
arrowstyle=arrow_style, arrowsize=20, ax=ax)
ax.set_title('arrow: {}'.format(arrow_style_lst[i]), fontsize=15),
ax.set_axis_off()
plt.tight_layout()
plt.savefig('../../assets/images/markdown_img/180813_arrow_style_comp.svg')
plt.show()
댓글남기기