-
Notifications
You must be signed in to change notification settings - Fork 0
/
rew-stat_ddcp.py
48 lines (35 loc) · 1.14 KB
/
rew-stat_ddcp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import matplotlib as mpl
mpl.use('Agg')
import pylab as pl
import numpy as np
import graph_tool as gt
import sys
sys.path.append("..")
from comp.functions import ( get_ddcp )
import pickle, scipy.stats
def plot_ddcp(eps_frac, gid, nbin):
'''
plot distance dependent connectivity profile
'''
gpath = '/home/lab/comp/data/aniso-netw_N1000' +\
'_w37.3_ed-l296_4GX7-{:s}.gt'.format(gid)
g = gt.load_graph(gpath)
hpath = '/home/lab/comp/data/rew-stat_aniso' +\
'_rf1.00_ef{:.2f}-{:s}.gt'.format(eps_frac,gid)
h = gt.load_graph(hpath)
gcenters, gprobs = get_ddcp(g, nbin)
hcenters, hprobs = get_ddcp(h, gcenters)
pl.plot(gcenters, gprobs, label='original')
pl.plot(hcenters, hprobs, label='rewired')
gid = '0bae'
efracs = [0.,0.01,0.02,0.05,0.10,0.15,0.25, 0.5]
#efracs = [0.05]
for eps_frac in efracs:
fig = pl.figure()
ax = fig.add_subplot(111)
plot_ddcp(eps_frac, gid, 150)
pl.legend()
import os
fname = os.path.splitext(os.path.basename(__file__))[0]
pl.savefig('{:s}_ef{:.2f}.png'.format(fname, eps_frac),
dpi=300, bbox_inches='tight')