ibllib.plots

Functions

color_cycle

Gets the matplotlib color-cycle as RGB numpy array of floats between 0 and 1 :return:

spectrum

param w

signal

squares

Matplotlib display of rising and falling fronts in a square-wave pattern

vertical_lines

From a x vector, draw separate vertical lines at each x location ranging from ymin to ymax

wiggle

Matplotlib display of wiggle traces

Classes

Density

Traces

wiggle(w, fs=1, gain=0.71, color='k', ax=None, fill=True, linewidth=0.5, t0=0, clip=2, **kwargs)[source]

Matplotlib display of wiggle traces

Parameters
  • w – 2D array (numpy array dimension nsamples, ntraces)

  • fs – sampling frequency

  • gain – display gain

  • color – (‘k’) color of traces

  • ax – (None) matplotlib axes object

  • fill – (True) fill variable area above 0

  • t0

    1. timestamp of the first sample

Returns

None

class Density(w, fs=1, cmap='bone', ax=None, **kwargs)[source]

Bases: object

on_key_press(event)[source]
class Traces(w, fs=1, gain=0.71, color='k', ax=None, linewidth=0.5, t0=0, **kwargs)[source]

Bases: object

on_key_press(event)[source]
squares(tscale, polarity, ax=None, yrange=[- 1, 1], **kwargs)[source]

Matplotlib display of rising and falling fronts in a square-wave pattern

Parameters
  • tscale – time of indices of fronts

  • polarity – polarity of front (1: rising, -1:falling)

  • ax – matplotlib axes object

Returns

None

vertical_lines(x, ymin=0, ymax=1, ax=None, **kwargs)[source]

From a x vector, draw separate vertical lines at each x location ranging from ymin to ymax

Parameters
  • x – numpy array vector of x values where to display lnes

  • ymin – lower end of the lines (scalar)

  • ymax – higher end of the lines (scalar)

  • ax – (optional) matplotlib axis instance

Returns

None

spectrum(w, fs)[source]
Parameters
  • w – signal

  • fs – sampling frequency (Hz)

  • smooth – (None) frequency samples to smooth over

  • unwrap – (True) unwraps the phase specrum

  • axis – axis on which to compute the FFT

  • kwargs – plot arguments to be passed to matplotlib

Returns

matplotlib axes

color_cycle(ind=None)[source]

Gets the matplotlib color-cycle as RGB numpy array of floats between 0 and 1 :return: