brainbox.ephys_plots

Functions

image_crosscorr_plot

Prepare data for 2D cross correlation plot of data across depth

image_fr_plot

Prepare data 2D raster plot of firing rate across recording

image_lfp_spectrum_plot

Prepare data for 2D image plot of LFP power spectrum along depth of probe

image_rms_plot

Prepare data for 2D image plot of RMS data along depth of probe

line_amp_plot

Prepare data for 1D line plot of average firing rate across depth :param spike_amps: :param spike_depths: :param spike_times: :param chn_coords: :param d_bin: depth bin to average across (see also brainbox.processing.bincount2D) :param display: :return:

line_fr_plot

Prepare data for 1D line plot of average firing rate across depth

probe_lfp_spectrum_plot

Prepare data for 2D probe plot of LFP power spectrum along depth of probe

probe_rms_plot

Prepare data for 2D probe plot of RMS along depth of probe

scatter_amp_depth_fr_plot

Prepare data for 2D scatter plot of cluster depth vs cluster amp with colour indicating cluster firing rate

scatter_raster_plot

Prepare data for 2D raster plot of spikes with colour and size indicative of spike amplitude

image_lfp_spectrum_plot(lfp_power, lfp_freq, chn_coords, chn_inds, freq_range=0, 300, avg_across_depth=False, cmap='viridis', display=False)[source]

Prepare data for 2D image plot of LFP power spectrum along depth of probe

Parameters
  • lfp_power

  • lfp_freq

  • chn_coords

  • chn_inds

  • freq_range

  • avg_across_depth – Whether to average across channels at same depth

  • cmap

  • display – generate figure

Returns

ImagePlot object, if display=True also returns matplotlib fig and ax objects

image_rms_plot(rms_amps, rms_times, chn_coords, chn_inds, avg_across_depth=False, median_subtract=True, cmap='plasma', band='AP', display=False)[source]

Prepare data for 2D image plot of RMS data along depth of probe

Parameters
  • rms_amps

  • rms_times

  • chn_coords

  • chn_inds

  • avg_across_depth – Whether to average across channels at same depth

  • median_subtract – Whether to apply median subtraction correction

  • cmap

  • band – Frequency band of rms data, can be either ‘LF’ or ‘AP’

  • display – generate figure

Returns

ImagePlot object, if display=True also returns matplotlib fig and ax objects

scatter_raster_plot(spike_amps, spike_depths, spike_times, n_amp_bins=10, cmap='BuPu', subsample_factor=100, display=False)[source]

Prepare data for 2D raster plot of spikes with colour and size indicative of spike amplitude

Parameters
  • spike_amps

  • spike_depths

  • spike_times

  • n_amp_bins – no. of colour and size bins into which to split amplitude data

  • cmap

  • subsample_factor – factor by which to subsample data when too many points for efficient

display :param display: generate figure :return: ScatterPlot object, if display=True also returns matplotlib fig and ax objects

image_fr_plot(spike_depths, spike_times, chn_coords, t_bin=0.05, d_bin=5, cmap='binary', display=False)[source]

Prepare data 2D raster plot of firing rate across recording

Parameters
  • spike_depths

  • spike_times

  • chn_coords

  • t_bin – time bin to average across (see also brainbox.processing.bincount2D)

  • d_bin – depth bin to average across (see also brainbox.processing.bincount2D)

  • cmap

  • display – generate figure

Returns

ImagePlot object, if display=True also returns matplotlib fig and ax objects

image_crosscorr_plot(spike_depths, spike_times, chn_coords, t_bin=0.05, d_bin=40, cmap='viridis', display=False)[source]

Prepare data for 2D cross correlation plot of data across depth

Parameters
  • spike_depths

  • spike_times

  • chn_coords

  • t_bin – t_bin: time bin to average across (see also brainbox.processing.bincount2D)

  • d_bin – depth bin to average across (see also brainbox.processing.bincount2D)

  • cmap

  • display – generate figure

Returns

ImagePlot object, if display=True also returns matploltlib fig and ax objects

scatter_amp_depth_fr_plot(spike_amps, spike_clusters, spike_depths, spike_times, cmap='hot', display=False)[source]

Prepare data for 2D scatter plot of cluster depth vs cluster amp with colour indicating cluster firing rate

Parameters
  • spike_amps

  • spike_clusters

  • spike_depths

  • spike_times

  • cmap

  • display – generate figure

Returns

ScatterPlot object, if display=True also returns matplotlib fig and ax objects

probe_lfp_spectrum_plot(lfp_power, lfp_freq, chn_coords, chn_inds, freq_range=0, 4, display=False, pad=True, x_offset=1)[source]

Prepare data for 2D probe plot of LFP power spectrum along depth of probe

Parameters
  • lfp_power

  • lfp_freq

  • chn_coords

  • chn_inds

  • freq_range

  • display

  • pad – whether to add nans around the individual image plots. For matplotlib use pad=True,

for pyqtgraph use pad=False :param x_offset: Distance between the channel banks in x direction :return: ProbePlot object, if display=True also returns matplotlib fig and ax objects

probe_rms_plot(rms_amps, chn_coords, chn_inds, cmap='plasma', band='AP', display=False, pad=True, x_offset=1)[source]

Prepare data for 2D probe plot of RMS along depth of probe

Parameters
  • rms_amps

  • chn_coords

  • chn_inds

  • cmap

  • band

  • display

  • pad – whether to add nans around the individual image plots. For matplotlib use pad=True,

for pyqtgraph use pad=False :param x_offset: Distance between the channel banks in x direction :return: ProbePlot object, if display=True also returns matplotlib fig and ax objects

line_fr_plot(spike_depths, spike_times, chn_coords, d_bin=10, display=False)[source]

Prepare data for 1D line plot of average firing rate across depth

Parameters
  • spike_depths

  • spike_times

  • chn_coords

  • d_bin – depth bin to average across (see also brainbox.processing.bincount2D)

  • display

Returns

line_amp_plot(spike_amps, spike_depths, spike_times, chn_coords, d_bin=10, display=False)[source]

Prepare data for 1D line plot of average firing rate across depth :param spike_amps: :param spike_depths: :param spike_times: :param chn_coords: :param d_bin: depth bin to average across (see also brainbox.processing.bincount2D) :param display: :return: