0
我使用的igraph使用igraph.plot()来生成网络图,但我只能得到这些流行起来,没有真正节省,而无需手动保存每个人物:保存iGraph python数字?
def testplot(graph):
graph.vs['label'] = graph.vs['name']
x = plot(graph, vertex_size=[a/5 for a in graph.betweenness()],
layout = graph.layout('grid'))
x.show()
当我尝试做以下,其中plt是matplotlib:
def testplot(graph, name):
graph.vs['label'] = graph.vs['name']
igraph.plot(graph, vertex_size=[a/5 for a in graph.betweenness()],
layout = graph.layout('grid'))
plt.savefig(name + '_allyBetweenness.png')
它保存一个空的图片。有小费吗?
谢谢你,那正是我正在寻找! –