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)
评论列表
文章目录