-
Notifications
You must be signed in to change notification settings - Fork 1
/
plot_stats_hourly.py
executable file
·71 lines (56 loc) · 8.48 KB
/
plot_stats_hourly.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python
import datetime
import pickle, sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from mpl_toolkits.basemap import *
import matplotlib.gridspec as gridspec
from matplotlib.colors import ListedColormap,BoundaryNorm
def plot_stats_hourly(ptype='fss'):
fig = plt.figure(figsize=(8,4))
ax1 = plt.gca()
numrows, numcols = 1,1
numpanels = numrows*numcols
gs = gridspec.GridSpec(numrows,numcols)
gs.update(hspace=0.07)
fontsize=10
lw=3.5; ms=3
fig.suptitle('', fontsize=fontsize+2)
### top panel
ax1 = plt.subplot(gs[0])
ax1.tick_params(bottom=True, axis='both', width=0.5, direction='out', labelsize=fontsize-2, labelbottom=True)
ax1.set_xlim((1,36))
ax1.set_xticks([1,6,12,18,24,30,36])
ax1.grid(color='0.7', linewidth=0.25)
for axis in ['top','bottom','left','right']: ax1.spines[axis].set_linewidth(0.5)
for i in range(0,37,24): ax1.axvspan(i,i+12,ymin=0,ymax=1,facecolor='gray',alpha=0.25)
bss_fhr_sspf_diff = [-0.2008405551,-0.1588581909,-0.1156245271,-0.113286933,-0.1053814171,-0.09610952647,-0.09524203511,-0.0852372005,-0.08776976104,-0.0711165082,-0.08643198579,-0.09257752687,-0.09478200258,-0.09300183653,-0.08468434796,-0.08462964805,-0.09545082536,-0.1184069365,-0.1263605514,-0.1252389111,-0.1205786752,-0.1225986475,-0.1186756913,-0.1130613952,-0.1050329186,-0.09699117501,-0.09272454424,-0.0863384995,-0.08777218698,-0.08561084542,-0.08830969387,-0.08692495603,-0.08320415551,-0.07579311129,-0.07807547981,-0.08001890375]
bss_fhr_uhonly_diff = [-0.1479331521,-0.1201398852,-0.08428555648,-0.08137863343,-0.07932649666,-0.07567314875,-0.07357433786,-0.0729931279,-0.07381213592,-0.05933909997,-0.0688764598,-0.07498887143,-0.0753767167,-0.07313223726,-0.06201098747,-0.06075430476,-0.05875199362,-0.06824090722,-0.07816854836,-0.08211311738,-0.08199065317,-0.08258979653,-0.07839525332,-0.07384161503,-0.06873075266,-0.06382337364,-0.06514621638,-0.06562475071,-0.0649940804,-0.06839661554,-0.06846457824,-0.06270192843,-0.05850970578,-0.05086735241,-0.04879469895,-0.04974668142]
bss_fhr_basicplus_diff = [-0.03354519462,-0.02054610014,-0.00403093354,-0.01766890203,-0.03005952074,-0.03701626164,-0.03901463737,-0.03670838887,-0.0296509325,-0.01433853706,-0.01238083591,-0.01452119551,-0.022774595,-0.03409243048,-0.03027908597,-0.02963392516,-0.02748544887,-0.02639867221,-0.02774942003,-0.03213178314,-0.04060352148,-0.04994172644,-0.05335521491,-0.0571966576,-0.05784516774,-0.05164462686,-0.04612128606,-0.04283580368,-0.03450544099,-0.03358049018,-0.02750532027,-0.028380213,-0.03216069639,-0.03286866227,-0.02817015624,-0.02721122353]
bss_fhr_envonly_diff = [-0.00970392762,-0.007294747869,-0.01689132671,-0.02326506022,-0.0335563817,-0.04166527436,-0.0474637708,-0.047778772,-0.04284529803,-0.03246377949,-0.03425002149,-0.05635142365,-0.07440834248,-0.08027415039,-0.07865126101,-0.05484121351,-0.03750830437,-0.03124632448,-0.03407960584,-0.04156850325,-0.05230638981,-0.0595869442,-0.06159075818,-0.06289147972,-0.05752782154,-0.05172395317,-0.0506687258,-0.04846293401,-0.04375730845,-0.04167960276,-0.036915136,-0.03269457647,-0.02957649643,-0.03286212873,-0.03714390038,-0.04181349803]
bss_fhr_noupper_diff = [-0.04254622972,-0.0305949992,-0.01808515203,-0.008839744163,-0.003232131314,-0.0008990752337,-0.002610108757,-0.005935533487,-0.007267380241,-0.0123976771,-0.00948690991,-0.007152866832,-0.005445759484,-0.004340712802,-0.00274251907,-0.004457917438,-0.009414700307,-0.01053182467,-0.01035834364,-0.008036819068,-0.006644051554,-0.006214510534,-0.004647936665,-0.002631463131,-0.001424793763,-0.001033249887,0.0008271316358,0.0008115978097,-0.003141443534,-0.00416247112,-0.008860117152,-0.008584241326,-0.00925651786,-0.00892895855,-0.008516722612,-0.009103518549]
auc_fhr_sspf_diff = [-0.1616501381,-0.1433777712,-0.1275079713,-0.1302148487,-0.1249490292,-0.123043384,-0.1282900602,-0.1312104993,-0.1313646101,-0.1611490598,-0.1781879549,-0.1876411714,-0.1928112762,-0.1785145305,-0.1834279273,-0.175851529,-0.136243897,-0.1166939148,-0.1007788173,-0.09013506158,-0.08220969965,-0.08350894862,-0.08036314251,-0.08017598316,-0.08235667612,-0.08394589796,-0.08668410951,-0.09336173461,-0.1018311272,-0.1099356221,-0.1211215098,-0.1240704198,-0.1396902302,-0.1536655907,-0.1797378778,-0.2159255104]
auc_fhr_uhonly_diff = [-0.07403408084,-0.06432843552,-0.05512207423,-0.0504832597,-0.04427247368,-0.0395731102,-0.03502819231,-0.03674130319,-0.03757785613,-0.03651867307,-0.03653974113,-0.03873903417,-0.03651422779,-0.03687624202,-0.03700604003,-0.03436589637,-0.03051672047,-0.02830087132,-0.02687189819,-0.02440989217,-0.02262082907,-0.02350512725,-0.02434439579,-0.02517790382,-0.02647964265,-0.02686503426,-0.0283338532,-0.02809501361,-0.02869101652,-0.02965870559,-0.03268862027,-0.03244013442,-0.03261131298,-0.03447065061,-0.03752831363,-0.04330729791]
auc_fhr_basicplus_diff = [-0.009582505038,-0.006296376963,-0.003699854062,-0.00580845676,-0.007726982099,-0.009002291447,-0.009598192474,-0.00986468156,-0.009821478109,-0.009513553949,-0.008588373014,-0.008589668801,-0.009271745451,-0.01025528296,-0.008986908686,-0.009905152392,-0.01024694242,-0.01004387684,-0.01092282361,-0.01192205099,-0.01370481293,-0.01562305189,-0.01639872469,-0.01722460888,-0.017264297,-0.0155602806,-0.01413142048,-0.01370633497,-0.01225545682,-0.01078207789,-0.009134949637,-0.008141093924,-0.00790908616,-0.007260194579,-0.007145038552,-0.00522724632]
auc_fhr_envonly_diff = [-0.001627495026,-0.001936130454,-0.004338801174,-0.004648898579,-0.005487026607,-0.006503540093,-0.007028369672,-0.00807270127,-0.008254732008,-0.008294545002,-0.008331707824,-0.009924719476,-0.01164282279,-0.01298310052,-0.0122886163,-0.01019798289,-0.009890167066,-0.009053141621,-0.009073378221,-0.009930928562,-0.0116169169,-0.01247546866,-0.01336172786,-0.01461152176,-0.01483759156,-0.01432894661,-0.01355413718,-0.01282096497,-0.01127749138,-0.0103654703,-0.009803536595,-0.009640576525,-0.008514401375,-0.00828419053,-0.009496536139,-0.007871005249]
auc_fhr_noupper_diff = [-0.01246977777,-0.01020511239,-0.007954089394,-0.004726028024,-0.002668409642,-0.001722844269,-0.001066094141,-0.000775622721,-0.0008802277636,-0.000727692423,-0.0005113996641,-0.001148349209,-0.001375017802,-0.001079462324,-0.001541022672,-0.002034289836,-0.002751653328,-0.002374576234,-0.002113483008,-0.001815110241,-0.001653540999,-0.001716722161,-0.001754669472,-0.001773597235,-0.001771453614,-0.001583746601,-0.001031303537,-0.0007772970139,-0.001050219074,-0.00113575033,-0.001284856096,-0.001395711851,-0.001591208816,-0.0009093823158,-0.002061299391,-0.003120206157]
if ptype=='bss':
ax1.set_ylabel('BSS Reduction', fontsize=fontsize-1)
ax1.set_ylim((-0.25,0))
ax1.plot(range(1,37), bss_fhr_sspf_diff, marker='o', markersize=ms, markeredgecolor='black', markeredgewidth=0, markerfacecolor='white', linewidth=lw)
ax1.plot(range(1,37), bss_fhr_uhonly_diff, marker='o', markersize=ms, markeredgecolor='black', markeredgewidth=0, markerfacecolor='white', linewidth=lw)
ax1.plot(range(1,37), bss_fhr_basicplus_diff, marker='o', markersize=ms, markeredgecolor='black', markeredgewidth=0, markerfacecolor='white', linewidth=lw)
ax1.plot(range(1,37), bss_fhr_envonly_diff, marker='o', markersize=ms, markeredgecolor='black', markeredgewidth=0, markerfacecolor='white', linewidth=lw)
ax1.plot(range(1,37), bss_fhr_noupper_diff, marker='o', markersize=ms, markeredgecolor='black', markeredgewidth=0, markerfacecolor='white', linewidth=lw)
if ptype=='auc':
ax1.set_ylabel('ROCA Reduction', fontsize=fontsize-1)
ax1.set_ylim((-0.25,0))
ax1.plot(range(1,37), auc_fhr_sspf_diff, marker='o', markersize=ms, markeredgecolor='black', markeredgewidth=0, markerfacecolor='white', linewidth=lw)
ax1.plot(range(1,37), auc_fhr_uhonly_diff, marker='o', markersize=ms, markeredgecolor='black', markeredgewidth=0, markerfacecolor='white', linewidth=lw)
ax1.plot(range(1,37), auc_fhr_basicplus_diff, marker='o', markersize=ms, markeredgecolor='black', markeredgewidth=0, markerfacecolor='white', linewidth=lw)
ax1.plot(range(1,37), auc_fhr_envonly_diff, marker='o', markersize=ms, markeredgecolor='black', markeredgewidth=0, markerfacecolor='white', linewidth=lw)
ax1.plot(range(1,37), auc_fhr_noupper_diff, marker='o', markersize=ms, markeredgecolor='black', markeredgewidth=0, markerfacecolor='white', linewidth=lw)
plt.savefig('%s.pdf'%ptype)
plot_stats_hourly('bss')
plot_stats_hourly('auc')