I'm using networkX to plot graphs. and I want to change the color of a graph. I followed samples on the internet and following is my code:
def draw_graph():
colors = []
for i in range (nCount):
for j in range (nCount):
if ifActive(i,j,timeStep) == 1:
colors.append("r")
else:
colors.append("b")
print ("colores = ", colors)
color_map = []
nColor= nx.get_node_attributes(graph,'color')
for nc in nColor:
color_map.append(nColor[nc])
nx.draw(graph,pos=nx.spring_layout(graph),edge_color = colors , node_color = color_map,with_labels = True )
but I am faced with the following error:
edge_color must be a color or list of one color per edge
How can I solve this error?
