vocalpy.plot.annotation#
- vocalpy.plot.annotation(annot: Annotation, tlim: tuple | list | None = None, y_segments: float = 0.5, h_segments: float = 0.4, y_labels: float = 0.3, text_kwargs: dict | None = None, ax: Axes | None = None, label_color_map: dict | None = None) tuple[list[Rectangle], list[Text] | None] [source]#
Plot a
vocalpy.Annotation
.- Parameters:
- annotcrowsetta.Annotation
Annotation that has segments to be plotted (the Annotation.data.seq.segments attribute).
- tlimtuple, list
Limits of time axis (tmin, tmax) (i.e., x-axis). Default is None, in which case entire range of
t
will be plotted.- y_segmentsfloat
Height at which segments should be plotted. Default is 0.5 (assumes y-limits of 0 and 1).
- h_segmentsfloat, int
Height of rectangles that represent segments. Default is 0.4.
- y_labelsfloat
Height on y-axis at which segment labels (if any) are plotted. Default is 0.4.
- text_kwargsdict
Keyword arguments for
matplotlib.axes.Axes.text()
. Passed to the functionvocalpy.plot.annot.labels()
that plots labels usingAxes.text
method. Default is None.- axmatplotlib.axes.Axes
Axes on which to plot segments. Default is None, in which case a new figure with a single axes is created.
- label_color_mapdict, optional
A
dict
that maps string labels to colors (that are valid color arguments for matplotlib).- text_kwargsdict
Keyword arguments passed to the Axes.text method that plots the labels. Default is None.