Hi,
I've built a graph using the following code:
G = networkx.Graph()
G.add_edges_from([list(e) for e in P + Q + R])
colors = "bgrcmyk"
color_map = [colors[i] for i in range(n/2)]
# add colors
for i in range(len(P)):
edge = list(P[i])
G[edge[0]][edge[1]]['edge_color'] = color_map[i]
for i in range(len(P)):
edge = list(Q[perms[0][i]])
G[edge[0]][edge[1]]["color"] = color_map[perms[0][i]]
for i in range(len(P)):
edge = list(R[perms[1][i]])
G[edge[0]][edge[1]]["color"] = color_map[perms[1][i]]
which I then display using:
networkx.draw(G)
matplotlib.pyplot.show()
It displays fine, except that all edges are coloured in black instead of the colours I tried to assign in the above snippet. Any ideas?