Skip to content

Commit c2d4032

Browse files
authored
Add plot_estimates and plot_spike_train to srp_extrafuncs.py
1 parent 5abe8d5 commit c2d4032

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

srp_extrafuncs.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,32 @@ def plot_srp(model, target_dict, stimulus_dict, protocols=None):
399399

400400
plt.show()
401401

402+
403+
def plot_estimates(means):
404+
fig, axis = plt.subplots()
405+
xax = range(len(means))
406+
axis.plot(range(1, len(xax) + 1), means, lw=1, color="#cc3311")
407+
axis.spines['top'].set_visible(False)
408+
axis.spines['right'].set_visible(False)
409+
axis.set_ylabel("Predicted EPSC", labelpad=1, size=8)
410+
axis.set_xticks(range(1, len(xax) + 1))
411+
axis.set_xlabel("spike nr.", labelpad=1)
412+
fig.set_dpi(1200)
413+
fig.tight_layout()
414+
# plt.savefig(f"estimates_plot.svg", transparent=True)
415+
416+
417+
def plot_spike_train(spiketrain):
418+
fig, axis = plt.subplots()
419+
axis.plot(spiketrain, lw=0.7, color='black')
420+
axis.set_ylim(-0.005, 0.005)
421+
axis.axis("off")
422+
423+
fig.set_dpi(1200)
424+
fig.tight_layout()
425+
# plt.savefig(f"spike_train_plot.svg", transparent=True)
426+
427+
402428
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
403429
#
404430
# FITTING FUNCTIONS

0 commit comments

Comments
 (0)