NetworkX

Previous topic

networkx.drawing.nx_pylab.draw_networkx_labels

Next topic

networkx.drawing.nx_pylab.draw_circular

networkx.drawing.nx_pylab.draw_networkx_edge_labels

networkx.drawing.nx_pylab.draw_networkx_edge_labels(G, pos, edge_labels=None, font_size=10, font_color='k', font_family='sans-serif', font_weight='normal', alpha=1.0, bbox=None, ax=None, rotate=True, **kwds)

Draw edge labels.

Parameters :

G : graph

A networkx graph

pos : dictionary, optional

A dictionary with nodes as keys and positions as values. If not specified a spring layout positioning will be computed. See networkx.layout for functions that compute node positions.

ax : Matplotlib Axes object, optional

Draw the graph in the specified Matplotlib axes.

alpha: float :

The text transparency (default=1.0)

labels: dictionary :

Node labels in a dictionary keyed by edge two-tuple of text labels (default=None), Only labels for the keys in the dictionary are drawn.

font_size: int :

Font size for text labels (default=12)

font_color: string :

Font color string (default=’k’ black)

font_weight: string :

Font weight (default=’normal’)

font_family: string :

Font family (default=’sans-serif’)

bbox: Matplotlib bbox :

Specify text box shape and colors.

clip_on: bool :

Turn on clipping at axis boundaries (default=True)

Examples

>>> G=nx.dodecahedral_graph()
>>> edge_labels=nx.draw_networkx_edge_labels(G,pos=nx.spring_layout(G)) 

Also see the NetworkX drawing examples at http://networkx.lanl.gov/gallery.html