Home | Trees | Indices | Help |
---|
|
Draw networks with matplotlib (pylab).
Provides:
- draw()
- draw_networkx()
- draw_networkx_nodes()
- draw_networkx_edges()
- draw_networkx_labels()
- draw_circular
- draw_random
- draw_spectral
- draw_spring
- draw_shell
- draw_graphviz
Date: $Date: 2005-06-15 11:29:39 -0600 (Wed, 15 Jun 2005) $
Author: Aric Hagberg (hagberg@lanl.gov)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
__credits__ = """"""
|
|||
__revision__ = "$Id"
|
|
Draw the graph G with matplotlib (pylab). This is a pylab friendly function that will use the current pylab figure axes (e.g. subplot). pos is a dictionary keyed by vertex with a two-tuple of x-y positions as the value. See networkx.layout for functions that compute node positions. Usage: >>> from networkx import * >>> G=dodecahedral_graph() >>> draw(G) >>> pos=graphviz_layout(G) >>> draw(G,pos) >>> draw(G,pos=spring_layout(G)) Also see doc/examples/draw_* for more see pylab.scatter NB: this has the same name as pylab.draw so beware when using >>> from networkx import * since you will overwrite the pylab.draw function. A good alternative is to use >>> import pylab as P >>> import networkx as NX >>> G=NX.dodecahedral_graph() and then use >>> NX.draw(G) # networkx draw() and >>> P.draw() # pylab draw()
|
Draw the graph G with given node positions pos Usage: >>> from networkx import * >>> import pylab as P >>> ax=P.subplot(111) >>> G=dodecahedral_graph() >>> pos=spring_layout(G) >>> draw_networkx(G,pos,ax=ax) This is same as 'draw' but the node positions must be specified in the variable pos. pos is a dictionary keyed by vertex with a two-tuple of x-y positions as the value. See networkx.layout for functions that compute node positions. An optional matplotlib axis can be provided through the optional keyword ax. with_labels contols text labeling of the nodes Also see: draw_networkx_nodes() draw_networkx_edges() draw_networkx_labels() |
Draw nodes of graph G This draws only the nodes of the graph G. pos is a dictionary keyed by vertex with a two-tuple of x-y positions as the value. See networkx.layout for functions that compute node positions. nodelist is an optional list of nodes in G to be drawn. If provided only the nodes in nodelist will be drawn. see draw_networkx for the list of other optional parameters. |
Draw the edges of the graph G This draws only the edges of the graph G. pos is a dictionary keyed by vertex with a two-tuple of x-y positions as the value. See networkx.layout for functions that compute node positions. edgelist is an optional list of the edges in G to be drawn. If provided, only the edges in edgelist will be drawn. edgecolor can be a list of matplotlib color letters such as 'k' or 'b' that lists the color of each edge; the list must be ordered in the same way as the edge list. Alternatively, this list can contain numbers and those number are mapped to a color scale using the color map edge_cmap. For directed graphs, "arrows" (actually just thicker stubs) are drawn at the head end. Arrows can be turned off with keyword arrows=False. See draw_networkx for the list of other optional parameters. |
Draw node labels on the graph G pos is a dictionary keyed by vertex with a two-tuple of x-y positions as the value. See networkx.layout for functions that compute node positions. labels is an optional dictionary keyed by vertex with node labels as the values. If provided only labels for the keys in the dictionary are drawn. See draw_networkx for the list of other optional parameters. |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Sun Aug 17 12:04:44 2008 | http://epydoc.sourceforge.net |