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:
Comments
Post a Comment