plot
This commit is contained in:
parent
54c3c4896a
commit
fd142297da
25
code/plot_spikesduringbaselineactivity.py
Normal file
25
code/plot_spikesduringbaselineactivity.py
Normal file
@ -0,0 +1,25 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
from read_baseline_data import *
|
||||
from NixFrame import *
|
||||
from utility import *
|
||||
from IPython import embed
|
||||
|
||||
# plot and data values
|
||||
inch_factor = 2.54
|
||||
data_dir = '../data'
|
||||
dataset = '2018-11-09-ad-invivo-1'
|
||||
|
||||
# read spikes during baseline activity
|
||||
spikes = read_baseline_spikes(os.path.join(data_dir, dataset))
|
||||
# calculate interpike intervals and plot them
|
||||
interspikeintervals = np.diff(spikes)*1000
|
||||
|
||||
fig, ax = plt.subplots(figsize=(12/inch_factor, 8/inch_factor))
|
||||
plt.hist(interspikeintervals, bins=np.arange(0, np.max(interspikeintervals), 0.1))
|
||||
ax.set_xlabel('time [ms]', fontsize=14)
|
||||
ax.set_ylabel('number of interspikeintervals', fontsize=14)
|
||||
ax.spines["top"].set_visible(False)
|
||||
ax.spines["right"].set_visible(False)
|
||||
fig.tight_layout()
|
||||
plt.show()
|
Loading…
Reference in New Issue
Block a user