maad.util.plot_shape

maad.util.plot_shape(shape, params, row=0, ax=None, display_values=False)[source]

Plot shape features in a bidimensional plot.

Parameters:
shape: 1D array, pd.Series or pd.DataFrame

Shape features computed with shape_features function.

params: pd.DataFrame

Pandas dataframe returned by maad.features_rois.shape_features

row: int

Observation to be visualized

display_values: bool

Set to True to display the coefficient values. Default is False.

Returns:
ax: matplotlib.axes

Axes of the figure

Examples

>>> from maad.sound import load, spectrogram 
>>> from maad.features import shape_features, plot_shape 
>>> import numpy as np 
>>> s, fs = load('../data/spinetail.wav') 
>>> Sxx, ts, f, ext = spectrogram(s, fs) 
>>> shape, params = shape_features(np.log10(Sxx), resolution='high') 
>>> plot_shape(shape, params)