plt.clf()
plt.figure(figsize=(9, 6), dpi=300)
plt.subplots_adjust(left=0.15, right=0.9, top=0.85, bottom=0.15)
ax = plt.gca()
plt.style.use("ggplot")
plt.rcParams['axes.edgecolor'] = "black"
plt.rcParams['axes.facecolor'] = "white"
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.yaxis.set_ticks_position('left')
ax.xaxis.set_ticks_position('bottom')
df_con.groupby('Bnum').plot(x='dist',
                            y='Peak_amp',
                            ax=ax,
                            legend=False,
                            color=tableau(15),
                            linewidth=1,
                            alpha=0.3)
df_con_group.plot(x='dist',
                  y='Peak_amp',
                  ax=ax,
                  legend=False,
                  markersize=5,
                  color=tableau(20),
                  linewidth=2,
                  alpha=1)
df_TTX.groupby('Bnum').plot(x='dist',
                            y='Peak_amp',
                            ax=ax,
                            legend=False,
                            color=tableau(7),
예제 #2
0
        df.loc[index] = [
            soma_trace, dend1_trace, dend2_trace, dend3_trace, labels
        ]

df = df.sort_values(by=['labels'])

###############################################################
##### Overlay trace plot - soma
###############################################################
plt.close()
plt.clf()
plt.figure(figsize=(9, 6), dpi=100)
for i in range(nfile - 1):
    plt.plot(new_time,
             df['soma_trace'].iloc[i + 1],
             color=tableau(i + 1),
             label='Input w = ' + str('%.2f' % df['labels'].iloc[i + 1]),
             linewidth=2)
plt.xlim([0, 600])
plt.ylabel("mV", fontsize=25)
plt.xlabel("Time(ms)", fontsize=25)
plt.xticks(fontsize=20)
plt.yticks(fontsize=20)
plt.gca().grid(False)
plt.gca().set_facecolor('white')
# save("Simulated_Trace", path_to_json, ext="ps", close=False, verbose=True)
ut.save("Simulated_Trace", path_to_json, ext="png", close=True, verbose=True)
###############################################################
##### Overlay trace plot - dend0.3
###############################################################
plt.close()
예제 #3
0
plt.close()
plt.clf()
plt.figure(figsize = (9,6), dpi = 100)
plt.subplots_adjust(left=0.15, right=0.9, top=0.85, bottom=0.15)
ax = plt.gca()
plt.style.use("ggplot")
plt.rcParams['axes.edgecolor'] = "black"
plt.rcParams['axes.facecolor'] = "white"
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.grid(False)
# ax.spines['bottom'].set_visible(False)
ax.yaxis.set_ticks_position('left')
ax.xaxis.set_ticks_position('bottom')
plt.plot(df1['NMDA_weight'], df1['platamp'],linestyle = '--', marker = 'o',
markersize = 15, c = tableau(20), linewidth = 2, label = 'Model 1')
plt.plot(df2['NMDA_weight'], df2['platamp'],linestyle = '-', marker = '^',
markersize = 15, c = tableau(14), linewidth = 2, label = 'Model 2')
plt.xlabel("NMDA weight", size = 22, color = 'black')
plt.ylabel("Plateau Amp (mV)", size = 22, color = 'black')
ax.tick_params(labelsize=22, pad = 12, colors = "black")
ax.set_facecolor('white')
plt.xlim([0,1])
plt.ylim([0,25])
ax.set_facecolor('white')
plt.legend(loc = 'best', fontsize = 22)
title = "Platamp_Model_B&W"
# save(title, savepath, ext="pdf", close=False, verbose=True)
ut.save(title, savepath, ext="png", close=True, verbose=True)
###################################################
plt.close()
예제 #4
0
#################################
# Plot and save the figures
path_to_figure = path_to_json + 'New_Figs/'
plt.close()
plt.clf()
plt.figure(figsize = (9,6), dpi = 300)
plt.subplots_adjust(left=0.15, right=0.9, top=0.85, bottom=0.15)
ax = plt.gca()
plt.style.use("ggplot")
plt.rcParams['axes.edgecolor'] = "black"
plt.rcParams['axes.facecolor'] = "white"
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.yaxis.set_ticks_position('left')
ax.xaxis.set_ticks_position('bottom')
df_con.groupby('Bnum').plot(x='dist', y='Peak_amp', ax=ax, legend = False, color = tableau(15), linewidth = 1, alpha = 0.3)
df_con_group.plot(x = 'dist', y = 'Peak_amp', ax = ax, legend = False, markersize = 5, color = tableau(20), linewidth = 2, alpha = 1)
df_TTX.groupby('Bnum').plot(x='dist', y='Peak_amp', ax=ax, legend = False, color = tableau(7), linewidth = 1, alpha = 0.3)
df_TTX_group.plot(x = 'dist', y = 'Peak_amp', ax = ax, legend = False, markersize = 5, color = tableau(6), linewidth = 2, alpha = 1)
df_4AP.groupby('Bnum').plot(x='dist', y='Peak_amp', ax=ax, legend = False, color = tableau(5), linewidth = 1, alpha = 0.3)
df_4AP_group.plot(x = 'dist', y = 'Peak_amp', ax = ax, legend = False, markersize = 5, color = tableau(4), linewidth = 2, alpha = 1)
plt.xlabel("Distance to soma (um)", size = 22, color = "black")
plt.ylabel("Peak Amplitude (mV)", size = 22, color = "black")
plt.tick_params(labelsize=22, pad = 12, colors = "black")
# plt.xticks([])
plt.title("AP Amplitude vs. Distance", size = 20)
plt.ylim([20, 110])
plt.yticks(np.arange(20, 110, 20))
# ax.grid(False)
ax.set_facecolor('white')
title1 = "bAP_Amplitude"
width = 0.8
height = 0.75
plt.axes([left,bottom,width,height])
ax = plt.gca()
plt.style.use("ggplot")
plt.rcParams['axes.edgecolor'] = "black"
plt.rcParams['axes.facecolor'] = '#FFFFFF'
ax.set_facecolor('white')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.yaxis.set_ticks_position('left')
ax.xaxis.set_ticks_position('bottom')
ax.axhline(linewidth=3, color = 'black')
ax.axvline(linewidth=3, color = 'black')
ax.plot(df1['dist'], df1['soma_platamp'], linestyle = '-', marker = 'o', markersize=10,
color = tableau(14), linewidth = 1.5, markerfacecolor="None", markeredgecolor = tableau(20), markeredgewidth=1.5, label = "Basal #15")
ax.plot(df2['dist'], df2['soma_platamp'], linestyle = '--', marker = 'v', markersize=10,
color = tableau(14), linewidth = 1.5, markerfacecolor="None", markeredgecolor = tableau(20), markeredgewidth=1.5, label = "Basal #34")
ax.plot(df3['dist'], df3['soma_platamp'], linestyle = '-', marker = '^', markersize=10,
color = tableau(14), linewidth = 1.5, markerfacecolor="None", markeredgecolor = tableau(20), markeredgewidth=1.5, label = "Basal #14")
ax.plot(df4['dist'], df4['soma_platamp'], linestyle = '--', marker = '*', markersize=10,
color = tableau(14), linewidth = 1.5, markerfacecolor="None", markeredgecolor = tableau(20), markeredgewidth=1.5, label = "Basal #22")
ax.plot(df5['dist'], df5['soma_platamp'], linestyle = '-', marker = 's', markersize=10,
color = tableau(14), linewidth = 1.5, markerfacecolor="None", markeredgecolor = tableau(20), markeredgewidth=1.5, label = "Basal #25")
ax.plot(df6['dist'], df6['soma_platamp'], linestyle = '--', marker = '8', markersize=10,
color = tableau(14), linewidth = 1.5, markerfacecolor="None", markeredgecolor = tableau(20), markeredgewidth=1.5, label = "Basal #31")
ax.set_xlim([0, 250])
ax.set_xlabel("Input distance from soma (um)", size = 22, color = 'black')
ax.set_ylabel("Amplitude in soma (mV)", size = 22, color = 'black')
plt.tick_params(labelsize=22, pad = 12, direction='in', length=6, width=2, colors = 'black')
plt.yticks(np.arange(0, 31, step=5))
예제 #6
0
plt.style.use("ggplot")
plt.rcParams['axes.edgecolor'] = "black"
plt.rcParams['axes.facecolor'] = '#FFFFFF'
ax.set_facecolor('white')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.yaxis.set_ticks_position('left')
ax.xaxis.set_ticks_position('bottom')
ax.axhline(linewidth=3, color='black')
ax.axvline(linewidth=3, color='black')
ax.plot(df1['dist'],
        df1['soma_platamp'],
        linestyle='-',
        marker='o',
        markersize=10,
        color=tableau(14),
        linewidth=1.5,
        markerfacecolor="None",
        markeredgecolor=tableau(20),
        markeredgewidth=1.5,
        label="Basal #15")
ax.plot(df2['dist'],
        df2['soma_platamp'],
        linestyle='--',
        marker='v',
        markersize=10,
        color=tableau(14),
        linewidth=1.5,
        markerfacecolor="None",
        markeredgecolor=tableau(20),
        markeredgewidth=1.5,