diff --git a/py/bayesian_inference.py b/py/bayesian_inference.py deleted file mode 100644 index 01ef6b0..0000000 --- a/py/bayesian_inference.py +++ /dev/null @@ -1,9 +0,0 @@ -# To add a new cell, type '#%%' -# To add a new markdown cell, type '#%% [markdown]' - -#%% - -import numpy as np - -np.arange(16) - diff --git a/py/bayesian_inference.py b/py/bayesian_inference.py deleted file mode 100644 index 01ef6b0..0000000 --- a/py/bayesian_inference.py +++ /dev/null @@ -1,9 +0,0 @@ -# To add a new cell, type '#%%' -# To add a new markdown cell, type '#%% [markdown]' - -#%% - -import numpy as np - -np.arange(16) - diff --git a/py/spike_train_visualization.py b/py/spike_train_visualization.py new file mode 100644 index 0000000..09488d9 --- /dev/null +++ b/py/spike_train_visualization.py @@ -0,0 +1,33 @@ +#%% [markdown] +# This snippet plots a spiking train in a raster plot. +# `spike_times` contains the timestamp for each even in the spike train. + + +#%% +import numpy as np +import matplotlib.pyplot as plt +import seaborn as sns + +# Set the theme +sns.set_style("white") + +# generate random timestamps (0 to 100s) +spike_times = np.random.random([8,50]) * 100 + + +#* creating the plot. It also accepts color and linelength as arrays for colors and lengths. +plt.eventplot(spike_times, + color="blue", + linelength=0.9) + +# title and axis +plt.title("Sample spike train plot") +plt.xlabel("time") +# plt.ylabel("channels") +#plt.axis('off') +plt.yticks(np.arange(0, 8),[f'Channel {l+1}' for l in range(8)]) + + +plt.show() + +#%% diff --git a/py/bayesian_inference.py b/py/bayesian_inference.py deleted file mode 100644 index 01ef6b0..0000000 --- a/py/bayesian_inference.py +++ /dev/null @@ -1,9 +0,0 @@ -# To add a new cell, type '#%%' -# To add a new markdown cell, type '#%% [markdown]' - -#%% - -import numpy as np - -np.arange(16) - diff --git a/py/spike_train_visualization.py b/py/spike_train_visualization.py new file mode 100644 index 0000000..09488d9 --- /dev/null +++ b/py/spike_train_visualization.py @@ -0,0 +1,33 @@ +#%% [markdown] +# This snippet plots a spiking train in a raster plot. +# `spike_times` contains the timestamp for each even in the spike train. + + +#%% +import numpy as np +import matplotlib.pyplot as plt +import seaborn as sns + +# Set the theme +sns.set_style("white") + +# generate random timestamps (0 to 100s) +spike_times = np.random.random([8,50]) * 100 + + +#* creating the plot. It also accepts color and linelength as arrays for colors and lengths. +plt.eventplot(spike_times, + color="blue", + linelength=0.9) + +# title and axis +plt.title("Sample spike train plot") +plt.xlabel("time") +# plt.ylabel("channels") +#plt.axis('off') +plt.yticks(np.arange(0, 8),[f'Channel {l+1}' for l in range(8)]) + + +plt.show() + +#%% diff --git a/py/stan.py b/py/stan.py index c4884ed..738f7fc 100644 --- a/py/stan.py +++ b/py/stan.py @@ -167,4 +167,3 @@ plt.title("Posterior distribution of alpha") plt.show() -#%%