如何使用python nrtworkx將圖放大?
問題描述

生成圖片太小,不能看清節點間連線,太過密集,望能給出解決方法
# _*_ coding:utf-8 _*_import matplotlib.pyplot as pltimport networkx as nxG = nx.DiGraph()#加載文件中邊的關系with open(’bigdata.txt’) as f: lines = f.readlines()mylist = [line.strip().split() for line in lines] pos =nx.spring_layout(G)outlist = []for i in range(len(mylist)): a = mylist[i][0] for j in range(len(mylist[i])-1):outlist.append([a, mylist[i][j+1]])#加載邊G.add_edges_from(outlist)nx.draw(G, with_labels=True, node_size=200,width=0.3, node_color=’r’, alpha = 0.7, edge_color=’black’,edge_vmin=2,edge_vmax=3)plt.savefig(’test1.png’)plt.show()
問題解答
回答1:建議網絡圖使用d3py,或者設置matplotlib的畫布大小
相關文章:
1. nignx - docker內nginx 80端口被占用2. docker容器呢SSH為什么連不通呢?3. javascript - 連續點擊觸發mouseleave事件4. docker - 各位電腦上有多少個容器啊?容器一多,自己都搞混了,咋辦呢?5. 關于docker下的nginx壓力測試6. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””7. mac里的docker如何命令行開啟呢?8. docker gitlab 如何git clone?9. dockerfile - 我用docker build的時候出現下邊問題 麻煩幫我看一下10. angular.js使用$resource服務把數據存入mongodb的問題。

網公網安備