modified firing characterization plot
This commit is contained in:
parent
cf39d16187
commit
8229291655
@ -200,10 +200,10 @@ def plot_sqrt(ax, a=1, b=0.2, c=100, d=0):
|
|||||||
def plot_AUC(ax, a=1, b=0.2, c=180, d=0, width=0.2):
|
def plot_AUC(ax, a=1, b=0.2, c=180, d=0, width=0.2):
|
||||||
x = np.linspace(0, 1, 1000)
|
x = np.linspace(0, 1, 1000)
|
||||||
y = c*np.sqrt(a*(x - b)) + d
|
y = c*np.sqrt(a*(x - b)) + d
|
||||||
ax.plot(x, y, colorslist[2])
|
ax.plot(x, y, colorslist[9])
|
||||||
ax.set_xlabel('Current [nA]')
|
ax.set_xlabel('Current [nA]')
|
||||||
ax.set_ylabel('Frequency [Hz]')
|
ax.set_ylabel('Frequency [Hz]')
|
||||||
ax.fill_between(x, y, where=(x<=b+width), color=lighter(colorslist[2], 0.3))
|
ax.fill_between(x, y, where=(x<=b+width), color=lighter(colorslist[9], 0.3))
|
||||||
ax.text(0.3, 15, 'AUC', ha='center')
|
ax.text(0.3, 15, 'AUC', ha='center')
|
||||||
ax.annotate('', (0.2, 10), (0, 10), arrowprops=dict(arrowstyle="<->"))
|
ax.annotate('', (0.2, 10), (0, 10), arrowprops=dict(arrowstyle="<->"))
|
||||||
ax.text(0.1, 20, 'rheobase', ha='center')
|
ax.text(0.1, 20, 'rheobase', ha='center')
|
||||||
@ -226,19 +226,19 @@ def plot_diff_sqrt(ax, a=1, b=0.2, c=100, d=0, a2=1, b2=0.2, c2=100, d2=0):
|
|||||||
def plot_quadrant(ax):
|
def plot_quadrant(ax):
|
||||||
ax.spines['left'].set_position('zero')
|
ax.spines['left'].set_position('zero')
|
||||||
ax.spines['bottom'].set_position('zero')
|
ax.spines['bottom'].set_position('zero')
|
||||||
ax.text(1.15, -0.15, '$\\Delta$ rheobase', ha='right')
|
ax.text(1.2, 0.05, '$\\Delta$ rheobase', ha='right')
|
||||||
ax.text(-0.05, 0.9, '$\\Delta$ AUC', ha='right')
|
ax.text(-0.05, 0.75, '$\\Delta$ AUC', ha='right', rotation=90)
|
||||||
ax.tick_params(length=0)
|
ax.tick_params(length=0)
|
||||||
ax.set_xlim(-1, 1)
|
ax.set_xlim(-1, 1)
|
||||||
ax.set_ylim(-1, 1)
|
ax.set_ylim(-1, 1)
|
||||||
ax.annotate('', (1, 0), (-1, 0), arrowprops=dict(arrowstyle="->"))
|
ax.annotate('', (1, 0), (-1, 0), arrowprops=dict(arrowstyle="->"))
|
||||||
ax.annotate('', (0, 1), (0, -1), arrowprops=dict(arrowstyle="->"))
|
ax.annotate('', (0, 1), (0, -1), arrowprops=dict(arrowstyle="->"))
|
||||||
ax.set_xticks([-0.4, 0.4])
|
ax.set_xticks([-0.5, 0.5])
|
||||||
a = ax.get_xticks().tolist()
|
a = ax.get_xticks().tolist()
|
||||||
a[0] = '\u2212'
|
a[0] = '\u2212'
|
||||||
a[1] = '+'
|
a[1] = '+'
|
||||||
ax.set_xticklabels(a)
|
ax.set_xticklabels(a)
|
||||||
ax.set_yticks([-0.4, 0.4])
|
ax.set_yticks([-0.5, 0.5])
|
||||||
b = ax.get_xticks().tolist()
|
b = ax.get_xticks().tolist()
|
||||||
b[0] = '\u2212'
|
b[0] = '\u2212'
|
||||||
b[1] = '+'
|
b[1] = '+'
|
||||||
@ -252,18 +252,20 @@ def plot_quadrant(ax):
|
|||||||
scheme_style()
|
scheme_style()
|
||||||
|
|
||||||
fig = plt.figure(figsize=cm2inch(7, 12))
|
fig = plt.figure(figsize=cm2inch(7, 12))
|
||||||
gs = gridspec.GridSpec(3,2, top=0.95, bottom=0.1, left=0.15, right = 0.95, hspace=0.8, wspace=0.6)
|
gs = gridspec.GridSpec(3,6, top=0.95, bottom=0.1, left=0.15, right = 0.95, hspace=0.8, wspace=0.6)
|
||||||
ax1 = fig.add_subplot(gs[0,:])
|
ax1 = fig.add_subplot(gs[0,1:])
|
||||||
show_spines(ax1, 'lb')
|
show_spines(ax1, 'lb')
|
||||||
plot_AUC(ax1, width=0.2)
|
plot_AUC(ax1, width=0.2)
|
||||||
ax3 = fig.add_subplot(gs[1:, :])
|
ax3 = fig.add_subplot(gs[1:, :])
|
||||||
|
|
||||||
# add panel letter labels
|
# add panel letter labels
|
||||||
ax_list = fig.axes
|
# ax_list = fig.axes
|
||||||
i =0
|
# i =0
|
||||||
for a in ax_list:
|
# for a in ax_list:
|
||||||
a.text(-0.25, 1.08, string.ascii_uppercase[i], transform=a.transAxes,size=16, weight='bold')
|
# a.text(-0.25, 1.08, string.ascii_uppercase[i], transform=a.transAxes,size=16, weight='bold')
|
||||||
i += 1
|
# i += 1
|
||||||
|
ax1.text(-0.25, 1.2, string.ascii_uppercase[0], transform=ax1.transAxes, size=16, weight='bold')
|
||||||
|
ax3.text(-0.02, 1.05, string.ascii_uppercase[1], transform=ax3.transAxes, size=16, weight='bold')
|
||||||
|
|
||||||
show_spines(ax3, '')
|
show_spines(ax3, '')
|
||||||
ax3.set_ylabel('$\Delta$ AUC')
|
ax3.set_ylabel('$\Delta$ AUC')
|
||||||
@ -299,3 +301,4 @@ plot_diff_sqrt(ax3_BR, b2=0.4, c2=75)
|
|||||||
ax3_BR.set_ylim(inset_ylim)
|
ax3_BR.set_ylim(inset_ylim)
|
||||||
fig.set_size_inches(cm2inch(8.17,12))
|
fig.set_size_inches(cm2inch(8.17,12))
|
||||||
fig.savefig('./Figures/firing_characterization.pdf', dpi=fig.dpi) #bbox_inches='tight', dpi=fig.dpi
|
fig.savefig('./Figures/firing_characterization.pdf', dpi=fig.dpi) #bbox_inches='tight', dpi=fig.dpi
|
||||||
|
plt.show()
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user