-
-
Save antonia-had/71ab2612c206162da85a71cd4dde157d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handles = [] | |
labels=[] | |
fig = plt.figure() | |
ax=fig.add_subplot(1,1,1) | |
for i in range(len(p)): | |
ax.fill_between(P, np.min(expData_sort[:,:],1), np.percentile(expData_sort[:,:], p[i], axis=1), color='#4286f4', alpha = 0.1) | |
ax.plot(P, np.percentile(expData_sort[:,:], p[i], axis=1), linewidth=0.5, color='#4286f4', alpha = 0.3) | |
handle = matplotlib.patches.Rectangle((0,0),1,1, color='#4286f4', alpha=alpha(i, base=0.1)) | |
handles.append(handle) | |
label = "{:.0f} %".format(100-p[i]) | |
labels.append(label) | |
ax.plot(P,hist_sort, c='black', linewidth=2, label='Historical record') | |
ax.set_xlim(0,100) | |
ax.legend(handles=handles, labels=labels, framealpha=1, fontsize=8, loc='upper left', title='Frequency in experiment',ncol=2) | |
ax.set_xlabel('Shortage magnitude percentile', fontsize=12) | |
plt.savefig('experiment_data_density.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment