Home > Software engineering >  python networkx - how to draw graph with varying edge width
python networkx - how to draw graph with varying edge width

Time:04-07

Based on enter image description here

It is almost the result as I want it, however I don't know why the edge (7,8) is so big even though the weight is relatively small (i.e. compared to edge (2,3)). Reversely the edge (6,7) is way smaller than then edge (5,6). Is this a bug? Or am I doing something wrong? I double checked the ordering of the weight array but couldn't find a mistake. Any help is appreciated!

CodePudding user response:

In your code, you are directly using the nparray weights to assign the widths to the edges. But the order of weights in your original array doesn't necessarily follow the order of edges in the graph (and how they are rendered).

Look at this older question. enter image description here

  • Related