Exemplo n.º 1
0
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')

ax1.legend(['loss', 'val_loss'], loc=2)
ax1.spines['top'].set_visible(False)
ax1.spines['right'].set_visible(False)

loss_20 = loss[-20:]
val_loss_20 = val_loss[-20:]

inset_axes = inset_axes(
    ax1,
    width="40%",  # width = 30% of parent_bbox
    height="40%",  # height : 1 inch
    loc=1)

inset_axes.plot(loss_20, color='y')
inset_axes.plot(val_loss_20, color='c')
inset_axes.set_xlabel('Last 20 Epochs')
inset_axes.set_ylabel('Loss')
inset_axes.spines['top'].set_visible(False)
inset_axes.spines['right'].set_visible(False)
inset_axes.spines['bottom'].set_visible(False)
inset_axes.get_xaxis().set_ticks([])
#inset_axes.spines['right'].set_visible(False)
#inset_axes.set_yscale('log')
#ax1.set_ylim(0.55, 0.8)
#inset_axes.legend(['loss', 'val_loss'])

ax2.hist(y_pred_test_even,
         25,
         density=1,
         histtype='step',
         weights=Wt_test_even,
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()