Those examples work for me, but when I try it with a more complicated
graph, they do not.
Here is the core of my code:
edgecolor=[]
for line in file:
s= line.split()
if(s[0]=="NODE"):
G.add_node(s[1])
if(s[0]=="EDGE"):
G.add_edge(s[1], s[2])
edgecolor.append('b')
nx.draw(G, edge_color=edgecolor, node_size=10.0, with_labels = False)
Even if I try
for line in file:
s= line.split()
if(s[0]=="NODE"):
G.add_node(s[1])
if(s[0]=="EDGE"):
G.add_edge(s[1], s[2])
for i in G.edges():
edgecolor.append('r')
It still doesn't work.
My file is formatted like:
NODE 1
NODE 2
...
NODE 6559
NODE 6560
EDGE 4 2651
EDGE 6 6528
EDGE 6 6529
...
EDGE 6554 4789
EDGE 6554 4790
There are no nodes with edges to themselves.
I get the same error:
ValueError: edge_color must be a single color or list of exactly m
colors where m is the number or edges
I'm probably missing something obvious in here, but I haven't been
able to solve it, at all. I'd really appreciate any help in solving
this problem... if you need any more information, please let me know.
On Nov 23, 7:34 pm, Aric Hagberg <
ahagb...@gmail.com> wrote: