如何使用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. dockerfile - 为什么docker容器启动不了?2. 对html实现监测 发现不对3. nignx - docker内nginx 80端口被占用4. debian - docker依赖的aufs-tools源码哪里可以找到啊?5. html5 - node静态资源服务器设置了Cache-Control,但浏览器从来不走3046. 关于docker下的nginx压力测试7. 为什么我ping不通我的docker容器呢???8. docker内创建jenkins访问另一个容器下的服务器问题9. docker - 各位电脑上有多少个容器啊?容器一多,自己都搞混了,咋办呢?10. docker镜像push报错

网公网安备