brainpy.visualization.raster_plot

brainpy.visualization.raster_plot(ts, sp_matrix, ax=None, marker='.', markersize=2, color='k', xlabel='Time (ms)', ylabel='Neuron index', xlim=None, ylim=None, title=None, show=False)[source]

Show the rater plot of the spikes.

Parameters
  • ts (np.ndarray) – The run times.

  • sp_matrix (np.ndarray) – The spike matrix which records the spike information. It can be easily accessed by specifying the monitors of NeuGroup by: neu = NeuGroup(..., monitors=['spike'])

  • ax (Axes) – The figure.

  • markersize (int) – The size of the marker.

  • color (str) – The color of the marker.

  • xlim (list, tuple) – The xlim.

  • ylim (list, tuple) – The ylim.

  • xlabel (str) – The xlabel.

  • ylabel (str) – The ylabel.

  • show (bool) – Show the figure.