%pylab inline import networkx as nx G=nx.star_graph(20) nx.draw(G) pos = nx.spring_layout(G) colors = range(20) nx.draw(G, pos, node_color='#A0CBE2', edge_color=colors, width=4, edge_cmap=plt.cm.Blues, with_labels=False)