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')
它保存一個空的圖片。有小費嗎?
謝謝你,那正是我正在尋找! –