I a using the networkx package of Python. The documentation says we can do H.add_edge(1,2,color='blue') but the output shows an edge with the default (black) color. When I do H.add_node(12,color='green') I get a new node with same default red color.
I a using the networkx package of Python. The documentation says we can do
Share
Peter, according to the documentation, to change the color with which nodes/edges are drawn, you have to provide the
node_colorargument to the drawing function. I.e. from this example, to draw a graph like this (note different colors of nodes):The code is:
Note the
node_colorargument to the second call todraw_networkx_nodes. Does this help?