Skip to main content

Home/ Python Programming/ Group items tagged networkx

Rss Feed Group items tagged

reckoner reckoner

XGraph plot dot showing multiple edges - networkx-discuss | Google Groups - 0 views

  • 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.
reckoner reckoner

pydot - Google Code - 0 views

  •  
    most of this seems built into networkx
reckoner reckoner

Nabble - Python Graph Theory sources - 0 views

  • For drawing you can use pygraphviz (also available at networkx.lanl.gov) or the built-in drawing tools.
1 - 4 of 4
Showing 20 items per page