update Fig 1, Fig 2 and diff tex file
This commit is contained in:
@@ -87,10 +87,15 @@ def add_scalebar(ax, matchx=True, matchy=True, hidex=True, hidey=True, **kwargs)
|
||||
def plot_spike_train(ax, model='RS Pyramidal', stop=750):
|
||||
model_spiking = pd.read_csv('./Figures/Data/model_spiking.csv')
|
||||
stop_ind = int(np.argmin(np.abs(model_spiking['t'] - stop)))
|
||||
# ax.plot(model_spiking['t'][0:stop_ind], model_spiking[model][0:stop_ind], 'k', linewidth=0.5)
|
||||
if model == 'STN':
|
||||
ax.plot(model_spiking['t'][0:stop_ind], model_spiking[model][0:stop_ind], 'k', linewidth=0.625)
|
||||
ax.plot(model_spiking['t'][0:stop_ind], model_spiking[model][0:stop_ind], 'k', linewidth=0.25)
|
||||
else:
|
||||
ax.plot(model_spiking['t'][0:stop_ind], model_spiking[model][0:stop_ind], 'k', linewidth=1.) #1.5
|
||||
ax.plot(model_spiking['t'][0:stop_ind], model_spiking[model][0:stop_ind], 'k', linewidth=0.5) #1.5
|
||||
# if model == 'STN':
|
||||
# ax.plot(model_spiking['t'][0:stop_ind], model_spiking[model][0:stop_ind], 'k', linewidth=0.625)
|
||||
# else:
|
||||
# ax.plot(model_spiking['t'][0:stop_ind], model_spiking[model][0:stop_ind], 'k', linewidth=1.) #1.5
|
||||
ax.set_ylabel('V')
|
||||
ax.set_xlabel('Time [s]')
|
||||
ax.set_ylim(-85, 60)
|
||||
@@ -136,9 +141,12 @@ def plot_fI(ax, model='RS Pyramidal'):
|
||||
fig = plt.figure()
|
||||
gs0 = fig.add_gridspec(3, 3, wspace=0.4, hspace=0.2)
|
||||
|
||||
gs00 = gs0[:,0].subgridspec(5, 3, wspace=1.8, hspace=1.5)
|
||||
gs01 = gs0[:,1].subgridspec(5, 3, wspace=1.8, hspace=1.5)
|
||||
gs02 = gs0[:,2].subgridspec(5, 3, wspace=1.8, hspace=1.5)
|
||||
# gs00 = gs0[:,0].subgridspec(5, 3, wspace=1.8, hspace=1.5)
|
||||
# gs01 = gs0[:,1].subgridspec(5, 3, wspace=1.8, hspace=1.5)
|
||||
# gs02 = gs0[:,2].subgridspec(5, 3, wspace=1.8, hspace=1.5)
|
||||
gs00 = gs0[:,0].subgridspec(5, 2, wspace=0.8, hspace=1.5)
|
||||
gs01 = gs0[:,1].subgridspec(5, 2, wspace=0.8, hspace=1.5)
|
||||
gs02 = gs0[:,2].subgridspec(5, 2, wspace=0.8, hspace=1.5)
|
||||
|
||||
ax_diag = fig.add_subplot(gs02[2:, :])
|
||||
import matplotlib.image as mpimg
|
||||
@@ -150,32 +158,60 @@ ax_diag.spines['left'].set_visible(False)
|
||||
ax_diag.spines['right'].set_visible(False)
|
||||
ax_diag.set_yticks([])
|
||||
ax_diag.set_xticks([])
|
||||
ax_diag.text(-0.12, 1.075, string.ascii_uppercase[12], transform=ax_diag.transAxes, size=10, weight='bold')
|
||||
# ax_diag.text(-0.12, 1.075, string.ascii_uppercase[12], transform=ax_diag.transAxes, size=10, weight='bold')
|
||||
ax_diag.text(-0.22, 1.075, string.ascii_uppercase[12], transform=ax_diag.transAxes, size=10, weight='bold')
|
||||
|
||||
ax1_spikes = fig.add_subplot(gs00[0,0:2])
|
||||
ax1_fI = fig.add_subplot(gs00[0, 2])
|
||||
ax2_spikes = fig.add_subplot(gs01[0,0:2])
|
||||
ax2_fI = fig.add_subplot(gs01[0, 2])
|
||||
ax3_spikes = fig.add_subplot(gs02[0,0:2])
|
||||
ax3_fI = fig.add_subplot(gs02[0, 2])
|
||||
ax4_spikes = fig.add_subplot(gs00[1,0:2])
|
||||
ax4_fI = fig.add_subplot(gs00[1, 2])
|
||||
ax5_spikes = fig.add_subplot(gs01[1, 0:2])
|
||||
ax5_fI = fig.add_subplot(gs01[1, 2])
|
||||
ax6_spikes = fig.add_subplot(gs02[1,0:2])
|
||||
ax6_fI = fig.add_subplot(gs02[1, 2])
|
||||
ax7_spikes = fig.add_subplot(gs00[2,0:2])
|
||||
ax7_fI = fig.add_subplot(gs00[2, 2])
|
||||
ax8_spikes = fig.add_subplot(gs01[2,0:2])
|
||||
ax8_fI = fig.add_subplot(gs01[2, 2])
|
||||
ax9_spikes = fig.add_subplot(gs00[3,0:2])
|
||||
ax9_fI = fig.add_subplot(gs00[3, 2])
|
||||
ax10_spikes = fig.add_subplot(gs01[3,0:2])
|
||||
ax10_fI = fig.add_subplot(gs01[3, 2])
|
||||
ax11_spikes = fig.add_subplot(gs00[4,0:2])
|
||||
ax11_fI = fig.add_subplot(gs00[4, 2])
|
||||
ax12_spikes = fig.add_subplot(gs01[4, 0:2])
|
||||
ax12_fI = fig.add_subplot(gs01[4, 2])
|
||||
|
||||
|
||||
ax1_spikes = fig.add_subplot(gs00[0,0])
|
||||
ax1_fI = fig.add_subplot(gs00[0, 1])
|
||||
ax2_spikes = fig.add_subplot(gs01[0,0])
|
||||
ax2_fI = fig.add_subplot(gs01[0, 1])
|
||||
ax3_spikes = fig.add_subplot(gs02[0,0])
|
||||
ax3_fI = fig.add_subplot(gs02[0, 1])
|
||||
ax4_spikes = fig.add_subplot(gs00[1,0])
|
||||
ax4_fI = fig.add_subplot(gs00[1, 1])
|
||||
ax5_spikes = fig.add_subplot(gs01[1, 0])
|
||||
ax5_fI = fig.add_subplot(gs01[1, 1])
|
||||
ax6_spikes = fig.add_subplot(gs02[1,0])
|
||||
ax6_fI = fig.add_subplot(gs02[1, 1])
|
||||
ax7_spikes = fig.add_subplot(gs00[2,0])
|
||||
ax7_fI = fig.add_subplot(gs00[2, 1])
|
||||
ax8_spikes = fig.add_subplot(gs01[2,0])
|
||||
ax8_fI = fig.add_subplot(gs01[2, 1])
|
||||
ax9_spikes = fig.add_subplot(gs00[3,0])
|
||||
ax9_fI = fig.add_subplot(gs00[3, 1])
|
||||
ax10_spikes = fig.add_subplot(gs01[3,0])
|
||||
ax10_fI = fig.add_subplot(gs01[3, 1])
|
||||
ax11_spikes = fig.add_subplot(gs00[4,0])
|
||||
ax11_fI = fig.add_subplot(gs00[4, 1])
|
||||
ax12_spikes = fig.add_subplot(gs01[4, 0])
|
||||
ax12_fI = fig.add_subplot(gs01[4, 1])
|
||||
|
||||
# ax1_spikes = fig.add_subplot(gs00[0,0:2])
|
||||
# ax1_fI = fig.add_subplot(gs00[0, 2])
|
||||
# ax2_spikes = fig.add_subplot(gs01[0,0:2])
|
||||
# ax2_fI = fig.add_subplot(gs01[0, 2])
|
||||
# ax3_spikes = fig.add_subplot(gs02[0,0:2])
|
||||
# ax3_fI = fig.add_subplot(gs02[0, 2])
|
||||
# ax4_spikes = fig.add_subplot(gs00[1,0:2])
|
||||
# ax4_fI = fig.add_subplot(gs00[1, 2])
|
||||
# ax5_spikes = fig.add_subplot(gs01[1, 0:2])
|
||||
# ax5_fI = fig.add_subplot(gs01[1, 2])
|
||||
# ax6_spikes = fig.add_subplot(gs02[1,0:2])
|
||||
# ax6_fI = fig.add_subplot(gs02[1, 2])
|
||||
# ax7_spikes = fig.add_subplot(gs00[2,0:2])
|
||||
# ax7_fI = fig.add_subplot(gs00[2, 2])
|
||||
# ax8_spikes = fig.add_subplot(gs01[2,0:2])
|
||||
# ax8_fI = fig.add_subplot(gs01[2, 2])
|
||||
# ax9_spikes = fig.add_subplot(gs00[3,0:2])
|
||||
# ax9_fI = fig.add_subplot(gs00[3, 2])
|
||||
# ax10_spikes = fig.add_subplot(gs01[3,0:2])
|
||||
# ax10_fI = fig.add_subplot(gs01[3, 2])
|
||||
# ax11_spikes = fig.add_subplot(gs00[4,0:2])
|
||||
# ax11_fI = fig.add_subplot(gs00[4, 2])
|
||||
# ax12_spikes = fig.add_subplot(gs01[4, 0:2])
|
||||
# ax12_fI = fig.add_subplot(gs01[4, 2])
|
||||
|
||||
spike_axs = [ax1_spikes, ax2_spikes, ax3_spikes, ax4_spikes, ax5_spikes,ax6_spikes, ax7_spikes, ax8_spikes,
|
||||
ax11_spikes,ax9_spikes,ax10_spikes, ax12_spikes]#, ax13_spikes, ax14_spikes]
|
||||
@@ -195,19 +231,30 @@ for i in range(len(models)):
|
||||
plot_fI(fI_axs[i], model=models[i])
|
||||
|
||||
# add scalebars
|
||||
# add_scalebar(ax6_spikes, matchx=False, matchy=False, hidex=True, hidey=True, sizex=100, sizey=50, labelx='100\u2009ms',
|
||||
# labely='50\u2009mV', loc=3, pad=-0.5, borderpad=-1.0, barwidth=2, bbox_to_anchor=Bbox.from_bounds(-0.275, -0.05, 1, 1),
|
||||
# bbox_transform=ax6_spikes.transAxes)
|
||||
# add_scalebar(ax11_spikes, matchx=False, matchy=False, hidex=True, hidey=True, sizex=100, sizey=50, labelx='100\u2009ms',
|
||||
# labely='50\u2009mV', loc=3, pad=-0.5, borderpad=-1.0, barwidth=2, bbox_to_anchor=Bbox.from_bounds(-0.275, -0.05, 1, 1),
|
||||
# bbox_transform=ax11_spikes.transAxes)
|
||||
# add_scalebar(ax12_spikes, matchx=False, matchy=False, hidex=True, hidey=True, sizex=100, sizey=50, labelx='100\u2009ms',
|
||||
# labely='50\u2009mV', loc=3, pad=-0.5, borderpad=-1.0, barwidth=2, bbox_to_anchor=Bbox.from_bounds(-0.275, -0.05, 1, 1),
|
||||
# bbox_transform=ax12_spikes.transAxes)
|
||||
add_scalebar(ax6_spikes, matchx=False, matchy=False, hidex=True, hidey=True, sizex=100, sizey=50, labelx='100\u2009ms',
|
||||
labely='50\u2009mV', loc=3, pad=-0.5, borderpad=-1.0, barwidth=2, bbox_to_anchor=Bbox.from_bounds(-0.275, -0.05, 1, 1),
|
||||
labely='50\u2009mV', loc=3, pad=-0.5, borderpad=-1.0, barwidth=2, bbox_to_anchor=Bbox.from_bounds(-0.475, -0.05, 1, 1),
|
||||
bbox_transform=ax6_spikes.transAxes)
|
||||
add_scalebar(ax11_spikes, matchx=False, matchy=False, hidex=True, hidey=True, sizex=100, sizey=50, labelx='100\u2009ms',
|
||||
labely='50\u2009mV', loc=3, pad=-0.5, borderpad=-1.0, barwidth=2, bbox_to_anchor=Bbox.from_bounds(-0.275, -0.05, 1, 1),
|
||||
labely='50\u2009mV', loc=3, pad=-0.5, borderpad=-1.0, barwidth=2, bbox_to_anchor=Bbox.from_bounds(-0.475, -0.05, 1, 1),
|
||||
bbox_transform=ax11_spikes.transAxes)
|
||||
add_scalebar(ax12_spikes, matchx=False, matchy=False, hidex=True, hidey=True, sizex=100, sizey=50, labelx='100\u2009ms',
|
||||
labely='50\u2009mV', loc=3, pad=-0.5, borderpad=-1.0, barwidth=2, bbox_to_anchor=Bbox.from_bounds(-0.275, -0.05, 1, 1),
|
||||
labely='50\u2009mV', loc=3, pad=-0.5, borderpad=-1.0, barwidth=2, bbox_to_anchor=Bbox.from_bounds(-0.475, -0.05, 1, 1),
|
||||
bbox_transform=ax12_spikes.transAxes)
|
||||
|
||||
|
||||
# add subplot labels
|
||||
for i in range(0,len(models)):
|
||||
# spike_axs[i].text(-0.18, 1.08, string.ascii_uppercase[i], transform=spike_axs[i].transAxes, size=10, weight='bold')
|
||||
spike_axs[i].text(-0.22, 1.2, string.ascii_uppercase[i], transform=spike_axs[i].transAxes, size=10, weight='bold')
|
||||
spike_axs[i].text(-0.572, 1.2, string.ascii_uppercase[i], transform=spike_axs[i].transAxes, size=10, weight='bold')
|
||||
# save
|
||||
fig.set_size_inches(cm2inch(21,15))
|
||||
fig.savefig('./Figures/diversity_in_firing_diagram.jpg', dpi=300, bbox_inches='tight') #pdf # eps
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 452 KiB After Width: | Height: | Size: 422 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 530 KiB After Width: | Height: | Size: 532 KiB |
@@ -117,6 +117,7 @@ def plot_g(ax, df, models, i, let_x, let_y, titlesize=10, letsize=12):
|
||||
c = [cm.gray(x) for x in np.linspace(0., 0.75, 9)]
|
||||
myorder = [0, 4, 1, 6, 2,7, 3,8]
|
||||
colors = [c[i] for i in myorder]
|
||||
ax.set_ylim(0.01, 60)
|
||||
df.plot.bar(y=models[i], rot=90, ax=ax, legend=False,
|
||||
ylabel='$\mathrm{g}_{\mathrm{max}}$ [$\mathrm{mS}/ \mathrm{cm}^2$]',
|
||||
color=colors)
|
||||
@@ -125,23 +126,24 @@ def plot_g(ax, df, models, i, let_x, let_y, titlesize=10, letsize=12):
|
||||
ax.text(let_x, let_y, string.ascii_uppercase[i], transform=ax.transAxes, size=letsize, weight='bold')
|
||||
ax.set_yscale('log')
|
||||
ax.set_xlim(-0.5, 9)
|
||||
ymin, ymax = ax.get_ylim()
|
||||
# ax.set_ylim(0.001, df[models[i]].max())
|
||||
# ymin, ymax = ax.get_ylim()
|
||||
# ax.set_ylim(0.001, 60)
|
||||
from matplotlib.ticker import ScalarFormatter
|
||||
for axis in [ax.yaxis]:
|
||||
axis.set_major_formatter(ScalarFormatter())
|
||||
if i == 1 or i == 4:
|
||||
print(i)
|
||||
ax.set_yticks([0.1,1.0, 10])
|
||||
# if i == 1 or i == 4:
|
||||
# print(i)
|
||||
ax.set_yticks([0.1,1.0, 10])
|
||||
# ax.yaxis.set_major_formatter(ScalarFormatter())
|
||||
|
||||
# ax.set_yticklabels([0.1,1.0, 10])
|
||||
# ax.set_yscale('log')
|
||||
import matplotlib.ticker
|
||||
# ax.yaxis.set_minor_formatter(matplotlib.ticker.NullFormatter())
|
||||
# # ax.yaxis.set_minor_formatter(matplotlib.ticker.NullFormatter())
|
||||
locmin = matplotlib.ticker.LogLocator(base=10.0, subs=(0.1, 0.2, 0.4, 0.6, 0.8, 1, 2, 4, 6, 8, 10), numticks=100)
|
||||
ax.yaxis.set_minor_locator(locmin)
|
||||
ax.yaxis.set_minor_formatter(matplotlib.ticker.NullFormatter())
|
||||
ax.yaxis.set_tick_params(labelleft= True)
|
||||
return ax
|
||||
|
||||
|
||||
@@ -170,7 +172,7 @@ models = ['Cb stellate', 'RS Inhibitory', 'FS', 'RS Pyramidal', 'RS Inhibitory +
|
||||
'RS Pyramidal +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$', 'STN +$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$',
|
||||
'Cb stellate $\Delta$$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$',
|
||||
'STN $\Delta$$\mathrm{K}_{\mathrm{V}}\mathrm{1.1}$', 'STN']
|
||||
fig, axs = plt.subplots(4, 3, figsize=cm2inch(20, 20)) # , sharey=True)
|
||||
fig, axs = plt.subplots(4, 3, figsize=cm2inch(20, 20))#, sharey=True)
|
||||
plt.subplots_adjust(hspace=1.5, wspace=1.0)
|
||||
let_x = -0.6
|
||||
let_y = 1.2
|
||||
|
||||
Reference in New Issue
Block a user