Statistics
| Branch: | Revision:

iof-tools / networkxMiCe / networkx-master / examples / drawing / plot_edge_colormap.py @ 5cef0f13

History | View | Annotate | Download (458 Bytes)

1
#!/usr/bin/env python
2
"""
3
=============
4
Edge Colormap
5
=============
6

7
Draw a graph with matplotlib, color edges.
8
You must have matplotlib>=87.7 for this to work.
9
"""
10
# Author: Aric Hagberg (hagberg@lanl.gov)
11

    
12
import matplotlib.pyplot as plt
13
import networkx as nx
14

    
15
G = nx.star_graph(20)
16
pos = nx.spring_layout(G)
17
colors = range(20)
18
nx.draw(G, pos, node_color='#A0CBE2', edge_color=colors,
19
        width=4, edge_cmap=plt.cm.Blues, with_labels=False)
20
plt.show()