vak.plot.annot.plot_segments#
- vak.plot.annot.plot_segments(onsets, offsets, y=0.5, ax=None, line_kwargs=None)[source]#
plot segments on an axis.
Creates a collection of horizontal lines with the specified onsets and offsets all at height y and places them on the axes ax.
- Parameters:
onsets (numpy.ndarray) – onset times of segments
offsets (numpy.ndarray) – offset times of segments
y (float, int) – height on y-axis at which segments should be plotted. Default is 0.5.
ax (matplotlib.axes.Axes) – axes on which to plot segment. Default is None, in which case a new Axes instance is created
line_kwargs (dict) – keyword arguments passed to the LineCollection that represents the segments. Default is None.