In [1]:
from graph_tool.all import *
from pylab import *
g=load_graph("vaxemail.graphml")
graph_draw(g)


Out[1]:
(<PropertyMap object with key type 'Vertex' and value type 'vector<double>', for Graph 0x7f004c18b590, at 0x7f004c128290>,
 <PropertyMap object with key type 'Vertex' and value type 'bool', for Graph 0x7f004c18b590, at 0x7f008a8e5e50>)

In [18]:
pos = sfdp_layout(g)
graph_draw(g,vertex_color=[1,1,1,0],edge_pen_width=1.2,vertex_fill_color='gray', output="vaxemail.png")


Out[18]:
<PropertyMap object with key type 'Vertex' and value type 'vector<double>', for Graph 0x7f1cb0307750, at 0x7f1c6aa8a2d0>

In [3]:
in_hist = vertex_hist(g,"in")

In [1]:
import networkx as nx
import matplotlib.pyplot as plt
g=nx.read_graphml("vaxemail.graphml")
degin = sorted(g.in_degree().values(),reverse=True)
degout = sorted(g.out_degree().values(),reverse=True)
plt.loglog(degin,'b-',marker='o',label="In")
plt.loglog(degout,'r-',marker='o',label="Out")
plt.legend(bbox_to_anchor=(0., 1.02, 1., .102), ncol=2,mode="expand",loc=3, borderaxespad=0.)
plt.title("Degree rank plot")
plt.ylabel("degree")
plt.xlabel("rank")
plt.savefig("degree.png")

In [23]:
import operator
stats=nx.pagerank(g)
s= sorted(stats.iteritems(), key=operator.itemgetter(1),reverse=True)
[nx.get_node_attributes(g,'name')[x[0]] for x in s[0:10]]


Out[23]:
[u'@SYS$MAIL:JUNK',
 u'MARGOLIN',
 u'@SYS$MAIL:ENGINEER',
 u'@SYS$MAIL:EVERYBODY',
 u'KIM::MARGOLIN',
 u' MARGOLIN',
 u'FARRAND',
 u'SKIP',
 u'STUBBEN',
 u'@SYS$MAIL:EE']

In [ ]: