Draw the graph G using Matplotlib.
Draw the graph with Matplotlib with options for node positions, labeling, titles, and many other drawing features. See draw() for simple drawing without labels or axes.
Parameters : | G : graph
pos : dictionary, optional
with_labels : bool, optional (default=True)
ax : Matplotlib Axes object, optional
nodelist : list, optional (default G.nodes())
edgelist : list, optional (default=G.edges())
node_size : scalar or array, optional (default=300)
node_color : color string, or array of floats, (default=’r’)
node_shape : string, optional (default=’o’)
alpha : float, optional (default=1.0)
cmap : Matplotlib colormap, optional (default=None)
vmin,vmax : float, optional (default=None)
linewidths : [None | scalar | sequence]
width : float, optional (default=1.0)
edge_color : color string, or array of floats (default=’r’)
edge_ cmap : Matplotlib colormap, optional (default=None)
edge_vmin,edge_vmax : floats, optional (default=None)
style : string, optional (deafult=’solid’)
labels : dictionary, optional (deafult=None)
font_size : int, optional (default=12)
font_color : string, optional (default=’k’ black)
font_weight : string, optional (default=’normal’)
font_family : string, optional (default=’sans-serif’)
|
---|
See also
draw, draw_networkx_nodes, draw_networkx_edges, draw_networkx_labels, draw_networkx_edge_labels
Examples
>>> G=nx.dodecahedral_graph()
>>> nx.draw(G)
>>> nx.draw(G,pos=nx.spring_layout(G)) # use spring layout
>>> import pylab
>>> limits=pylab.axis('off') # turn of axis
Also see the NetworkX drawing examples at http://networkx.lanl.gov/gallery.html