reckoner reckoner's Library tagged → View Popular
networkx.draw — NetworkX v0.99 documentation
-
node_shape: node shape (default=’o’), or ‘so^>v<dph8’ see pylab.scatter
subclassing Graph and dealing with subgraph - networkx-discuss | Google Groups
-
from networkx import Graph
class FooGraph(Graph):
def __init__(self,**kwds):
Graph.__init__(self,kwds)
self.a=10
then,
Dijkstra's algorithm for shortest paths « ActiveState Code
-
Dijkstra(G,s) finds all shortest paths from s to each other vertex in the graph, and shortestPath(G,s,t) uses Dijkstra to find the shortest path from s to t. Uses the priorityDictionary data structure (Recipe 117228) to keep track of estimated distances to each vertex.
draw overlaid subgraphs? - networkx-discuss | Google Groups
-
For lining up two pictures of networks (for an overlay effect) make
sure you use the same pos (position) dict for each network. You
clearly have to have the same name for the nodes in each graph. See:
https://networkx.lanl.gov/browser/networkx/trunk/doc/examples/
draw_colors.py
XGraph plot dot showing multiple edges - networkx-discuss | Google Groups
-
For example edge labels can be added using matplotlib "text" objects
like this:
import networkx as nx
import pylab as plot
K=nx.XGraph(name="Konigsberg", multiedges=True, selfloops=False)
K.add_edges_from([("A","B","Honey Bridge"),
("A","B","Blacksmith's Bridge"),
("A","C","Green Bridge"),
("A","C","Connecting Bridge"),
("A","D","Merchant's Bridge"),
("C","D","High Bridge"),
("B","D","Wooden Bridge")])
pos=nx.spring_layout(K)
nx.draw_nx(K,pos)
xa,ya=pos['A']
xb,yb=pos['B']
plot.text((xa+xb)/2,(ya+yb)/2,"Blacksmith's Bridge")
plot.show()
With a little work you can get the label rotated and exactly how you
want it positioned. You can also set the node positions directly in the
"pos" dictionary above.
Selected Tags
Related Tags
Sponsored Links
Top Contributors
Groups interested in graphs
-
KLA Maths - Measurement & Data
Length, Area, Mass, Volume ...
Items: 63 | Visits: 70
Created by: Grace Kat
-
graphs
describes kinds of graphs a...
Items: 2 | Visits: 21
Created by: Susan Blankenbaker
Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »
Join Diigo
