visualizerasterplotrasterplot2_pdf_grouped

rasterplot2_pdf_grouped

visualize.rasterplot.rasterplot2_pdf_grouped(pdf, grouplabel, ax=None, xlim=None, x_offset=0, color='k')

Plot a rasterplot per group fo a spike times dataframe.

Similar to rasterplot2(), this method plots a rasterplot from a spike times dataframe, but groups them with horizontal lines, based on the grouplabel. Assumes the spike times dataframe has a column grouplabel

Parameters:
  • pdf (pandas.DataFrame) – A DataFrame containing the spike times. Must contain a column with label grouplabel.

  • grouplabel (str) – The column name in the DataFrame to group by.

  • ax (matplotlib.axes.Axes, optional) – An optional Matplotlib Axes object to plot on. If not provided, a new figure and axes are created.

  • xlim (tuple, optional) – The x-axis limits for the plot. Default is None.

  • x_offset (float, optional) – An offset to apply to the x-values (event times). Default is 0.

  • color (str, optional) – The color to use for the plot. Default is ‘k’.

Returns:

None.