Reputation: 195
I am new to netwrokx and I have a big network as follows that I need to just visualize its blue nodes:
Is there any way to see just blue nodes while the distance between them is same as the real graph's?
My desired output would be something like following one:
Result of using pos layout is as follows:
Joel helped med to find out the result and I share codes and outcome here for those who have the similar question:
Answer Codes:
pos = nx.spring_layout(G)
nx.draw_networkx(G, pos, nodelist = blue_nodes, node_color =
'blue',with_labels=False)
Upvotes: 0
Views: 300
Reputation: 23887
Given a network G
, with a list of "blue" nodes bluenodes
, we can define a set of positions, and then draw just the blue nodes.
pos = nx.spring_layout(G) #there are other layouts that you might want to try.
nx.draw_networkx_nodes(G, pos, nodelist = bluenodes, node_color = 'blue', with_labels=False)
Upvotes: 2