Search code examples
pythonnetworkxgephi

Exporting edge colors to Gephi from NetworkX


Adding colored nodes is covered here.

However, a similar method does not work for edges, it seems.

At the moment the edges of my graph are different colors in NetworkX, but Gephi can't seem to see that.

I have tried:

edge[2]['viz'] = {color: {'r': 255, 'g': 0, 'b': 0, 'a': 0}}

and Gephi just ignores the color property.

Is there a way to add colored edges?


Solution

  • The issue here was that I had alpha 'a' set to 0.

    Setting it to literally any positive number will solve the issue / save hours of your time.

    edge[2]['viz'] = {color: {'r': 255, 'g': 0, 'b': 0, 'a': 1.0}}