Skip to content

Instantly share code, notes, and snippets.

@millionsmile
Created June 21, 2012 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save millionsmile/2966625 to your computer and use it in GitHub Desktop.
Save millionsmile/2966625 to your computer and use it in GitHub Desktop.
Visualizing Organization Network by Python
# 『オープンソースで学ぶ社会ネットワーク分析』の図1-4のネットワーク図を描く
import networkx as net
import matplotlib.pyplot as plot
# pylabの全ての関数やオブジェクトをインポート(本に書かれてないコード)
from pylab import *
# "ACME_orgchart.net"はpythonを実行しているフォルダー内に置く
# "ACME_orgchart.net"は以下のGitHubよりDLできる
# https://github.com/maksim2042/SNABook/blob/master/chapter1/ACME_orgchart.net
orgchart=net.read_pajek("ACME_orgchart.net")
net.draw(orgchart)
# 図を描画するメソッド(これも本に書かれていないコード)
show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment