graphnetworkxpytorch-geometric

How to display only a portion of graph using PYG and networkx


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)

Solution

  • 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!