Skip to content

Commit

Permalink
new fig4 panel: tuned [#19]
Browse files Browse the repository at this point in the history
  • Loading branch information
felix11h committed Aug 19, 2018
1 parent bb2ac01 commit a73e9b8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 286 deletions.
3 changes: 2 additions & 1 deletion main/fig4_3motif_aniso-rew-dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,5 +262,6 @@ def plot_data(rlcs, errs, color, xshift, z_init, opacity=opacity):
import os
fname = os.path.splitext(os.path.basename(__file__))[0]

pl.savefig('{:s}.pdf'.format(fname), dpi=600)

pl.savefig('{:s}.pdf'.format(fname), dpi=600, bbox_inches='tight')

266 changes: 0 additions & 266 deletions main/fig4_3motif_aniso_rew_dist.py

This file was deleted.

40 changes: 23 additions & 17 deletions main/fig4_3motif_tuned-rew-dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def rel_counts_from_data(net_2motifs, net_3motifs):
r'\usepackage{color}'
]

pl.rcParams['xtick.major.pad']=+45.5
pl.rcParams['xtick.major.pad']=+57.5

fig = pl.figure(facecolor="white")
fig.set_size_inches(7.4,2.25)
Expand Down Expand Up @@ -172,33 +172,45 @@ def plot_data(rlcs, errs, color, xshift, z_init, opacity=opacity):



ax1.set_xlim(0.,17+1.25)
ymin, ymax = 0, 3.5
yscale = (ymax-ymin)/5.
ax1.set_ylim(ymin, ymax)
ax1.yaxis.set_ticks(range(0,4,1))

ax2.set_ylim(top=7.2)
ax2.yaxis.set_ticks(range(0,7,1))




# legend - not currently independent of axis vals
lbl_fntsz = 10
tick_fntsz = 9

xrect=0.9225
ystart=4.685
ydist=0.605
ystart=4.685*yscale
ydist=0.605*yscale

ax1.add_patch(Rectangle((xrect,ystart), 0.75, 0.2,
ax1.add_patch(Rectangle((xrect,ystart), 0.75, 0.2*yscale,
facecolor='white', edgecolor=color['tuned']))
ax1.add_patch(Rectangle((xrect,ystart), 0.75, 0.2,
ax1.add_patch(Rectangle((xrect,ystart), 0.75, 0.2*yscale,
facecolor=color['tuned'], edgecolor=color['tuned'],
alpha=opacity_tuned))
fig.text(0.225,0.85, r'tuned', color = 'k',
fontsize=lbl_fntsz)

ax1.add_patch(Rectangle((xrect,ystart-ydist), 0.75, 0.2,
ax1.add_patch(Rectangle((xrect,ystart-ydist), 0.75, 0.2*yscale,
facecolor='white', edgecolor='grey'))
ax1.add_patch(Rectangle((xrect,ystart-ydist), 0.75, 0.2,
ax1.add_patch(Rectangle((xrect,ystart-ydist), 0.75, 0.2*yscale,
facecolor='grey', edgecolor='grey',
alpha=opacity))
fig.text(0.225,0.75, r'tuned rewired', color = 'black',
fontsize=lbl_fntsz)

ax1.add_patch(Rectangle((xrect,ystart-2*ydist), 0.75, 0.2,
ax1.add_patch(Rectangle((xrect,ystart-2*ydist), 0.75, 0.2*yscale,
facecolor='white', edgecolor=color['dist']))
ax1.add_patch(Rectangle((xrect,ystart-2*ydist), 0.75, 0.2,
ax1.add_patch(Rectangle((xrect,ystart-2*ydist), 0.75, 0.2*yscale,
facecolor=color['dist'], edgecolor=color['dist'],
alpha=opacity))
fig.text(0.225,0.65, r'distance-dependent', color = 'black',
Expand Down Expand Up @@ -244,23 +256,17 @@ def plot_data(rlcs, errs, color, xshift, z_init, opacity=opacity):
tick_label.set_fontsize(tick_fntsz)


ax1.set_xlim(0.,17+1.25)
ymin, ymax = 0, 3.5
ax1.set_ylim(ymin, ymax)
ax1.yaxis.set_ticks(range(0,4,1))

ax2.set_ylim(top=6)
ax2.yaxis.set_ticks(range(0,6,1))

# make sure that y=1 is aligned
#between ax1 and ax2
align_yaxis(ax1, 1, ax2, 1)


for i in range(1,18):
draw_motifs(ax1, i, ymin, ymax, highlight=False)


import os
fname = os.path.splitext(os.path.basename(__file__))[0]

pl.savefig('{:s}.pdf'.format(fname), dpi=600)
pl.savefig('{:s}.pdf'.format(fname), dpi=600, bbox_inches='tight')
6 changes: 4 additions & 2 deletions utils/motif_draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ def draw_motifs(ax, i, ymin, ymax, highlight = False):
hwidth = 0.025/1.75*(ymax-ymin)
yoffset = 0.025/1.75*(ymax-ymin)

yscale=(ymax-ymin)/5.

xpos = 1.
ypos = -0.6
ypos = -0.6*yscale

frac = 0.3
alpha = np.arctan(ydist/xdist)
Expand All @@ -38,7 +40,7 @@ def draw_motifs(ax, i, ymin, ymax, highlight = False):

arrow_properties = {'length_includes_head': True,
'width': awidth,
'head_length': 0.1}
'head_length': 0.1*yscale}

bar_gray = {'head_width': 0,
'fc': a_gray,
Expand Down

0 comments on commit a73e9b8

Please sign in to comment.