network.py 文件源码

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

项目:py-ipv8 作者: qstokkink 项目源码 文件源码
def draw(self, filename="network_view.png"):
        """
        Draw this graph to a file, for debugging.
        """
        import matplotlib.pyplot as plt
        plt.clf()
        pos = circular_layout(self.graph)
        draw(self.graph, pos, with_labels=False, arrows=False, hold=False,
             edge_color=[self.graph[u][v]['color'] for u,v in self.graph.edges()],
             node_color=['orange' if v in self._all_addresses else 'green' for v in self.graph.nodes()])
        plt.savefig(filename)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号