apollon.aplot module

aplot.py – General plotting routines.

Functions:
fourplot Create a four plot of time a signal. marginal_distr Plot the marginal distribution of a PoissonHMM. onsets Plot onsets over a signal. onest_decoding Plot decoded onsets over a signal. signal Plot a time domain signal.
apollon.aplot.fourplot(data: numpy.ndarray, lag: int = 1) → tuple

Plot time series, lag-plot, histogram, and probability plot.

Parameters:
  • data – Input data set.
  • lag – Lag for lag-plot given in number of samples.
Returns:

Parameters

apollon.aplot.marginal_distr(train_data: numpy.ndarray, state_means: numpy.ndarray, stat_dist: numpy.ndarray, bins: int = 20, legend: bool = True, **kwargs) → tuple

Plot the marginal distribution of a PoissonHMM.

Parameters:
  • train_data – Training data set.
  • state_means – State dependend means.
  • stat_dist – Stationary distribution.
Returns:

Figure and Axes.

apollon.aplot.onset_decoding(odf: numpy.ndarray, onset_index: numpy.ndarray, decoding: numpy.ndarray, cmap='viridis', **kwargs) → tuple

Plot sig and and onsetes color coded regarding dec.

Parameters:
  • odf – Onset detection function or an arbitrary time series.
  • onset_index – Onset indices relative to odf.
  • decoding – State codes in [0, …, n].
  • cmap – Colormap for onsets.
Returns:

Figure and axes.

apollon.aplot.onsets(odf: numpy.ndarray, onset_index: numpy.ndarray, **kwargs) → tuple

Indicate onsets on a time series.

Parameters:
  • odf – Onset detection function or an arbitrary time series.
  • onset_index – Onset indices relative to odf.
Returns:

Figure and axes.

apollon.aplot.signal(values: numpy.ndarray, fps: int = None, time_scale: str = 'seconds', **kwargs) → tuple

Plot time series with constant sampling interval

Parameters:
  • values – Values of the time series.
  • fps – Sampling frequency in samples.
  • time_scale – Seconds or samples.
Returns:

Figure and axes.