#

Note

This documents the development version of NetworkX. Documentation for the current release can be found here.

#

Edge ColormapΒΆ

Draw a graph with matplotlib, color edges.

plot edge colormap
import matplotlib.pyplot as plt
import networkx as nx

G = nx.star_graph(20)
pos = nx.spring_layout(G)
colors = range(20)
options = {
    "node_color": "#A0CBE2",
    "edge_color": colors,
    "width": 4,
    "edge_cmap": plt.cm.Blues,
    "with_labels": False,
}
nx.draw(G, pos, **options)
plt.show()

Total running time of the script: ( 0 minutes 0.113 seconds)

Gallery generated by Sphinx-Gallery