英文:
How to display only a portion of graph using PYG and networkx
问题
有没有办法只可视化大图的一部分(例如,3万个节点)?
我尝试使用networkx可视化包含1万个节点的图,但由于图中大量节点重叠,无法获得有意义的图像。
g = torch_geometric.utils.to_networkx(data, to_undirected=True)
nx.draw(g, with_labels=True)
英文:
Is there way to visualize only a portion of a large graph (e.g. 30k nodes).
I tried to visualize a graph with 10k nodes using networkx. But it doesn't give a meaningful image due to a large no of overlapping nodes in the image.
g = torch_geometric.utils.to_networkx(data, to_undirected=True)
nx.draw(g, with_labels=True)
答案1
得分: 0
如果您使用nx.draw(g.subgraph([specifed_nodes]), with_labels=True),然后添加plt.show(),您应该能够获得图的部分。希望这有所帮助!
英文:
If you use nx.draw(g.subgraph([specifed_nodes]), with_labels=True) and then add plt.show() you should be able to get only part of the graph networkx documentation - Drawing
. Hope this helps!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论