vocalpy.plot.spect.spectrogram

Contents

vocalpy.plot.spect.spectrogram#

vocalpy.plot.spect.spectrogram(spect: Spectrogram, tlim: tuple | list | None = None, flim: tuple | list | None = None, ax: plt.Axes | None = None, pcolormesh_kwargs: dict | None = None) tuple[matplotlib.figure.Figure, matplotlib.axes.Axes][source]#

Plot a spectrogram.

Parameters:
spectrogramvocalpy.Spectrogram
tlimtuple, list

limits of time axis (min, max) (i.e., x-axis). Default is None, in which case entire range of t will be plotted.

flimtuple, list

limits of frequency axis (min, max) (i.e., x-axis). Default is None, in which case entire range of f will be plotted. limits of time axis (min, max) (i.e., x-axis). Default is None, in which case entire range of t will be plotted.

flimtuple, list

limits of frequency axis (min, max) (i.e., x-axis). Default is None, in which case entire range of f will be plotted.

axmatplotlib.axes.Axes

axes on which to plot spectrogram

pcolormesh_kwargsdict

keyword arguments passed to matplotlib.axes.Axes.pcolormesh() method used to plot spectrogram. Default is None.

Returns:
figmatplotlib.figure.Figure
axmatplotlib.axes.Axes

Examples

>>> samba = voc.example("samba.wav")
>>> spect = voc.spectrogram(samba)
>>> fig, ax = voc.plot.spectrogram(spect)
../../_images/vocalpy-plot-spect-spectrogram-1.png