示例#1
0
def casewise_hist():
    """DEPRECATED"""
    if debug:
        e = test_events()
    else:
        e = pip2015events()
    n_cases = e.events.paper.count()
    fd, axarrd = subplots(n_cases)
    fm, axarrm = subplots(n_cases)
    fn, axarrn = subplots(n_cases)
    for i, c in enumerate(e.events.paper.values):
        print(c)
        data = hist_data(c)
        plots(data, axarrd[i], axarrm[i], axarrn[i], title=c.dtstr(), y=0.85,
              fontdict={'verticalalignment': 'top', 'fontsize': 10})
    del(e)
    gc.collect()
    for f in (fd, fm, fn):
        sf.remove_subplot_gaps(f, axis='col')
    fd.savefig(path.join(savedir, 'd0_cases' + tld), **savekws)
    fm.savefig(path.join(savedir, 'mu_cases' + tld), **savekws)
    fn.savefig(path.join(savedir, 'nw_cases' + tld), **savekws)
示例#2
0
stats.to_csv(path.join(paths['tables'], 'hist_stats.csv'), sep='\t')

for ax in (axarrdd[-1], axarrmd[-1], axarrnd[-1]):
    ax.set_title('$\\rho > %s$' % (rhomin*read.RHO_SCALE), **titlekws)
    #ax.set_title('$\\rho > %s$' % rhomin, **titlekws)

ax_pdf_labeled = [axarrdd[1], axarrmd[1]]
ax_pdf_labeled.extend(list(axarra[1,:-1]))

for ax in ax_pdf_labeled:
    ax.set_ylabel('PDF')
for ax in (axarrnd[1], axarra[1,2]):
    ax.set_ylabel('Frequency')

for f in (fdd, fmd, fnd):
    sf.remove_subplot_gaps(f, axis='col')
sf.remove_subplot_gaps(fa, axis='col', axarr=axarra)
fnd.subplots_adjust(left=0.15) # prevent ylabel cutoff

tld = '.png'
savekws = {'dpi': 400}

fdd.savefig(path.join(savedir, 'd0_rho' + tld), **savekws)
fmd.savefig(path.join(savedir, 'mu_rho' + tld), **savekws)
fnd.savefig(path.join(savedir, 'nw_rho' + tld), **savekws)
fdd.savefig(path.join(paths['paper'], 'hist_d0' + tld), **savekws)
fmd.savefig(path.join(paths['paper'], 'hist_mu' + tld), **savekws)
fnd.savefig(path.join(paths['paper'], 'hist_nw' + tld), **savekws)

# Wat?
for axarr in (axarrdd, axarrmd, axarrnd):