plt.gca().set_color_cycle([colormap(i) for i in np.linspace(0, 0.9,len_index_alp)])
for i in list_index_alp: 
	fg2.plot(rates,myprobs_pres_nov[i],lw=12,ls='--',alpha=0.8)
fg2.set_xlim([0.01,30])
fg2.set_ylim([0,0.3])
fg2.set_yticks([0,0.1,0.2,0.3])
#fg2.set_xticks([0,0.1,0.2,0.3,0.4,0.5])
fg2.set_xlabel(r'Rate (Hz)',fontsize=45)
fg2.set_ylabel(r'Dist. Rates',fontsize=45)
fg2.tick_params(labelsize=35)
fg2.set_title('(A)',fontsize=50,fontweight="bold",y=1.06)
fg2.legend(loc=(0.01,0.47),numpoints=1,prop={'size':12})
inset_axes = inset_axes(fg2,width=5, height=3,loc=1,bbox_to_anchor=(0.345, 0.885),bbox_transform=fg2.figure.transFigure)
colormap = plt.cm.Accent
plt.gca().set_color_cycle([colormap(i) for i in np.linspace(0, 0.9,len_index_alp)])
for i in list_index_alp: 
	inset_axes.plot(rates,myprobs_pres_fam[i],lw=8,alpha=0.8)
colormap = plt.cm.Accent
plt.gca().set_color_cycle([colormap(i) for i in np.linspace(0, 0.9,len_index_alp)])
for i in list_index_alp: 
	inset_axes.plot(rates,myprobs_pres_nov[i],lw=8,ls='--',alpha=0.8)

inset_axes.set_xlim([25,100])
inset_axes.set_ylim([0,0.02])
inset_axes.set_xticks([25.,75,100])
inset_axes.set_yticks([0.02])
inset_axes.tick_params(labelsize=30)
inset_axes.set_xlabel(r'Rate (Hz)',fontsize=30)
plt.savefig('figA.pdf', bbox_inches='tight')

Exemple #2
0
# formatting the plot
ax.xaxis.set_minor_locator(pylab.MultipleLocator(5))
ax.yaxis.set_minor_locator(pylab.MultipleLocator(0.1))
ax.grid(b=True,which="minor",axis='x')
ax.grid(b=True,which="minor",axis='y')
ax.set_xticks(range(1850,2030,10))
ax.set_xlim(1843,2021)
ax.set_ylim(-1.03,0.89)
ax.set_xlabel("Year")
legend = ax.legend(loc="upper left",fontsize=14)
frame = legend.get_frame()
frame.set_facecolor('1.0')
ax.set_ylabel("Anomaly")

# adding an inset axis to view the downturn at the end better
inset_axes = zoomed_inset_axes(ax, 3, loc=4)
inset_axes.scatter(df2.Date,df2.Anomaly,s=15,marker='o',facecolor="1.0",lw=0.5,edgecolor="0.0")
inset_axes.plot(df2.Date[s12:-e12],yr1LP2,'-y',label='Annual LP')
inset_axes.plot(df2.Date[s152:-e152],yr15LP2,'-g',label='>15 yr LP')
inset_axes.plot(df2.Date[s752:-e752],yr75LP2,'-b',label='>30 yr LP')
inset_axes.plot(df2.Date,yr15SG2,'--r',label='S-G 15 yr')
x1, x2, y1, y2 = 2000, 2015, 0.3, 0.6
inset_axes.set_xlim(x1, x2)
inset_axes.set_ylim(y1, y2)
inset_axes.set_xticks([])
inset_axes.set_yticks([])
inset_axes.set_axis_bgcolor("1.0")
ax.set_title("HadCrut4 Monthly Anomaly Smoothing by CTRM and Savitsky-Golay")
mark_inset(ax, inset_axes, loc1=1, loc2=2, fc="none", ec="0.0");
pylab.show()
fg7.set_xlim([12,37])
fg7.set_ylim([0.45,1.])
fg7.set_yticks([0.5,0.75,1.])
fg7.set_xticks([15,20,25,30,35])
fg7.tick_params(axis='both', which='major', labelsize=30)
fg7.set_xlabel(r'Threshold ($x_f$)',fontsize=50)
fg7.set_ylabel(r'Proportion Pot./Dep. ($q_f$)',fontsize=50)

#fg7.axhline(y=.7, xmin=0, xmax=100, linewidth=10, color = 'b',alpha=0.5, linestyle='dashed')
# Make a colorbar for the ContourSet returned by the contourf call.
fg7.axvline(x=model_step.mean_patterns, ymin=0, ymax=1, linewidth=10, color = 'g',alpha=0.5, linestyle='dashed')
fg7.axvline(x=model_step.median_patterns, ymin=0, ymax=1, linewidth=10, color = 'peru',alpha=0.5, linestyle='dashed')
fg7.scatter(themaxcap[2][5:-1],themaxcap[3][5:-1],s=1000*(np.array(themaxcap[1][5:-1])/max(themaxcap[1])),alpha=0.5,color='b')
fg7.set_title('(F)',fontsize=50,fontweight="bold",y=1.06)
fg7.text(16,0.95,'Potentiation',fontsize=50)
fg7.text(28,0.8,'Depresion',fontsize=50)
inset_axes = inset_axes(fg7,width=5, height=3,loc=1,bbox_to_anchor=(0.895, 0.265),bbox_transform=fg7.figure.transFigure)
inset_axes.plot(themaxcap[0][5:-1],themaxcap[1][5:-1],lw=8,color='maroon',alpha=0.8)
inset_axes.set_xlim([0.5,7])
inset_axes.set_ylim([0.4,0.8])
#inset_axes.set_xticks([25.,75,100])
inset_axes.set_yticks([0.4,0.6,0.8])
inset_axes.tick_params(labelsize=30)
inset_axes.set_xlabel(r'A',fontsize=30)
inset_axes.set_ylabel(r'Larg.Max.Cap.($\alpha_c$)',fontsize=30)
#cbar.set_ticklabels([0.08,0.32,0.64])
plt.savefig('fig3.pdf', bbox_inches='tight')
print themaxcap[0][5]
#plt.show()