We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Originally found in #362
import matplotlib.pyplot as plt import numpy as np import quantities as pq from elephant import statistics, kernels from elephant.spike_train_generation import homogeneous_poisson_process np.random.seed(0) spiketrain = homogeneous_poisson_process(rate=10 * pq.Hz, t_stop=10 * pq.s) kernel = kernels.GaussianKernel(sigma=300 * pq.ms) sampling_period = 445 * pq.ms rate = statistics.instantaneous_rate( spiketrain, sampling_period=sampling_period, kernel=kernel, center_kernel=True, trim=False) plt.plot(rate.times.simplified.magnitude, rate.magnitude, color='orange', label='instantaneous rate') plt.eventplot( [spiketrain.simplified.magnitude, rate.times.simplified.magnitude], colors=['black', 'green'], lineoffsets=2, linelengths=1) plt.legend() plt.title(f"{kernel.__class__.__name__}: sigma={int(kernel.sigma.item())} ms, " f"sampling_period={int(sampling_period.item())} ms") plt.show()
On the plot above, the green stripes denote rate.times, which lacks one point before the t_stop.
rate.times
The text was updated successfully, but these errors were encountered:
Moritz-Alexander-Kern
No branches or pull requests
Originally found in #362
On the plot above, the green stripes denote
rate.times
, which lacks one point before the t_stop.The text was updated successfully, but these errors were encountered: