def draw_graph(G, labels, colors, show, save_path, close_plot=True):
nx.draw(G, pos=graphviz_layout(G, prog='dot'), labels=labels, arrows=True, node_color=colors)
if show:
plt.show()
else:
plt.savefig(save_path)
if close_plot:
plt.close()
评论列表
文章目录