python - draw_networkx() in networkx -


i getting error when trying networkx

networkx.draw_networkx(g,ax = self.axes) typeerror: draw_networkx() takes @ least 2 non-keyword arguments (1 given) 

the code same

g=networkx.graph() g.add_node("spam") g.add_edge(1,2) networkx.draw_networkx(g,ax = self.axes) 

can explain doing wrong , how can correct this.... link function draw_networkx.

thanks

it expecting pos argument, inform drawing routine how position nodes. here's how can use spring layout populate pos:

networkx.draw_networkx(g, pos=networkx.spring_layout(g), ax=self.axes) 

output:

enter image description here


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -