0

My nodes in graph each have different sizes. I need to determine their sizes when I add them in graph. But using either G.add_node('A',size=300)or G.add_node('A',node_size=300), after nx.draw('G') the size of A is unchanged at default size 100.

Back2Basics
  • 7,406
  • 2
  • 32
  • 45
  • Look at using nx.draw_networkx_node... – Scott Boston Jan 31 '19 at 03:49
  • I confront another problem when i try to use nx.draw_networkx_node. pos ={'A':(1,2)} nx.draw_networkx_nodes(G,pos,nodelist=['A'],node_size=[300],with_label=True).And appear an error that is " Node 'A' has no position."I can't figure out why. – teeth wu Jan 31 '19 at 05:31
  • Take at look at this SO article. It does alot of customization on drawing graphs. Different size and shapes of nodes etc... https://stackoverflow.com/a/52683100/6361531 – Scott Boston Jan 31 '19 at 14:36

0 Answers0