One easy way to turn your list into a dict (since the key
will be the index of the element) is dict(enumerate(yourlist))
Dan
> --
> You received this message because you are subscribed to the Google
> Groups "networkx-discuss" group.
> To post to this group, send email to networkx-
> dis...@googlegroups.com.
> To unsubscribe from this group, send email to networkx-discuss
> +unsub...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/
> group/networkx-discuss?hl=en.
>
You have to add the labels individual if you want separate colors (not
an optimal interface).
e.g.
import networkx as nx
import matplotlib.pyplot as plt
# draw graph without labels
G=nx.path_graph(4)
pos=nx.spring_layout(G)
nx.draw_networkx(G,pos,node_color='w',with_labels=False)
# set colors
colors=['r','g','b','c']
# draw node labels one-at-a-time with color
for node in G:
color=colors[node]
nx.draw_networkx_labels(G,pos,labels={node:node},font_color=color)
plt.show()
Aric