Colormap Not Working In Networkx
I am trying to make colored graphs. I keep running into odd behavior. I cannot get the colormap to assign colors automatically to the nodes. All nodes I try to do this with wind u
Solution 1:
As this is old and Lack answered the question in the comments I am copying his answer here and accepting:
I can't run your code without errors (
TypeError: 'complex' object has no attribute '__getitem__' on j[t]
) but it's the same problem as your other question which I answered (stackoverflow.com/questions/27831022/…). Because you pass only one node at a time todraw_networkx_nodes
, it "normalizes" the length-1 array of colors without regard to the other nodes. You should get rid of the loop and pass all the nodes in one array todraw_networkx_nodes
.
Post a Comment for "Colormap Not Working In Networkx"