ibllib.plots.misc

Functions

color_cycle

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

spectrum

Display spectral density of a signal along a given dimension spectrum(w, fs)

squares

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

vertical_lines

From an 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, sf=None, **kwargs)[source]

Matplotlib display of wiggle traces

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

  • fs – sampling frequency

  • gain – display gain ; Note that if sf is given, gain is not used

  • color – (‘k’) color of traces

  • ax – (None) matplotlib axes object

  • fill – (True) fill variable area above 0

  • t0

    1. timestamp of the first sample

  • sf – scaling factor ; if None, uses the gain / SQRT of waveform RMS

Returns:

None

class Density(w, fs=30000, cmap='Greys_r', ax=None, taxis=0, title=None, gain=None, t0=0, unit='ms', **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 an 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 lines

  • ymin – lower end of the lines (scalar)

  • ymax – higher end of the lines (scalar)

  • ax – (optional) matplotlib axis instance

Returns:

None

spectrum(w, fs, smooth=None, unwrap=True, axis=0, **kwargs)[source]

Display spectral density of a signal along a given dimension spectrum(w, fs)

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: