show_graph.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:community-detection 作者: msionkin 项目源码 文件源码
def show_graph(graph, with_labels=False):
    pos = nx.spring_layout(graph)
    nx.draw_networkx_nodes(graph, pos, node_size=200, node_color='red')
    if with_labels:
        nx.draw_networkx_labels(graph, pos, font_size=12)
    nx.draw_networkx_edges(graph, pos, alpha=0.3)
    plt.axis('off')
    plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号