Maybe you could try something like this:
import matplotlib.pyplot as plt
import networkx as nx
G=nx.Graph()
G.add_nodes_from('abc',color='red')
G.add_nodes_from('de',color='blue')
G.add_edges_from([('a','b'),('b','d'),('c','e'),('b','e')])
pos=nx.spring_layout(G)
blue_nodes=[n for n,d in G.nodes(data=True) if d['color']=='blue']
red_nodes=[n for n,d in G.nodes(data=True) if d['color']=='red']
nx.draw_networkx_nodes(G,pos,nodelist=blue_nodes,node_color='b')
nx.draw_networkx_nodes(G,pos,nodelist=red_nodes,node_color='r')
nx.draw_networkx_edges(G,pos)
plt.show()
Aric
--
You received this message because you are subscribed to the Google Groups "networkx-discuss" group.
To post to this group, send email to networkx...@googlegroups.com.
To unsubscribe from this group, send email to networkx-discu...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/networkx-discuss?hl=en.
Set the font to a different color? Or maybe change the alpha value of
the nodes?
nx.draw_networkx_nodes(G,pos,nodelist=blue_nodes,node_color='b',alpha=0.7)
nx.draw_networkx_nodes(G,pos,nodelist=red_nodes,node_color='r',alpha=0.7)
nx.draw_networkx_labels(G,pos,font_color='w')
Aric