Created
January 15, 2012 05:39
-
-
Save hideaki-t/1614517 to your computer and use it in GitHub Desktop.
Revisions
-
hideaki-t revised this gist
Jan 15, 2012 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ # coding: utf-8 import networkx G=networkx.Graph() -
hideaki-t created this gist
Jan 15, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ # coding: utf-8 import networkx G=networkx.Graph() from matplotlib import pyplot G.add_edge(u'池袋', u'新宿') G.add_edge(u'新宿', u'代々木') G.add_edge(u'代々木', u'品川') G.add_edge(u'品川', u'東京') G.add_edge(u'東京', u'神田') G.add_edge(u'神田', u'秋葉原') G.add_edge(u'秋葉原', u'日暮里') G.add_edge(u'日暮里', u'田端') G.add_edge(u'田端', u'池袋') G.add_edge(u'池袋', u'赤羽') G.add_edge(u'代々木', u'御茶ノ水') G.add_edge(u'東京', u'御茶ノ水') G.add_edge(u'秋葉原', u'御茶ノ水') G.add_edge(u'日暮里', u'赤羽') G.add_edge(u'田端', u'赤羽') pos = networkx.spring_layout(G) networkx.draw_networkx_nodes(G, pos, node_size=100, node_color='w') networkx.draw_networkx_edges(G, pos, width=1) networkx.draw_networkx_labels(G, pos, font_size=12, font_family='VL Gothic', font_color='r') pyplot.show()