You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature request:
Function to plot spiking activity of raster plot akin to one implemented in #309.
Integrating this function into Lava directly suggested by @mathisrichter in discussion of #309.
defraster_plot(spks, stride=6, fig=None, color='b', alpha=1):
"""Generate raster plot of spiking activity. Parameters ---------- spks : np.ndarray shape (num_neurons, timesteps) Spiking activity of neurons, a spike is indicated by a one stride : int Stride for plotting neurons """num_time_steps=spks.shape[1]
assertstride<num_time_steps, "Stride must be smaller than number of time steps"time_steps=np.arange(0, num_time_steps, 1)
iffigisNone:
fig=plt.figure(figsize=(10,5))
timesteps=spks.shape[1]
plt.xlim(-1, num_time_steps)
plt.yticks([])
plt.xlabel('Time steps')
plt.ylabel('Neurons')
foriinrange(0, dim, stride):
spike_times=time_steps[spks[i] ==1]
plt.plot(spike_times,
i*np.ones(spike_times.shape),
linestyle=' ',
marker='o',
markersize=1.5,
color=color,
alpha=alpha)
returnfig
The text was updated successfully, but these errors were encountered:
Lava version:
I'm submitting a ...
Feature request:
Function to plot spiking activity of raster plot akin to one implemented in #309.
Integrating this function into Lava directly suggested by @mathisrichter in discussion of #309.
The text was updated successfully, but these errors were encountered: