plotDurs

emlib.matplotting.plotDurs(durs, y0=0.0, x0=0.0, height=1.0, labels=None, color=None, ax=None, groupLabel='', profile={'alpha': 0.75, 'annotation_alpha': 0.3, 'annotation_color': (0, 0, 0), 'autoscale': True, 'background': (0, 0, 0), 'colormap': 'jet', 'edgecolor': 1, 'facecolor': 0.8, 'label_alpha': 0.75, 'label_font': 'sans-serif', 'label_size': 10, 'line_alpha': 0.8, 'line_style': 'solid', 'linewidth': 1}, stacked=False)[source]

Plot durations as contiguous rectangles

Parameters:
  • durs (list[float]) – the durations expressed in seconds

  • y0 – y of origin

  • x0 – x of origin

  • height – the height of the drawn rectangles

  • labels (list[str]) – if given, a label for each rectangle

  • color (_colort | None) – the color used for the rectangles

  • ax (Axes) – the axes to draw on. If not given, a new axes is created (and returned)

  • groupLabel – a label for the group

  • profile – the profile used, or None to use a default

  • stacked – if True, the rectangles are drawn stacked vertically (the duration is still drawn horizontally). The result is then similar to a bars plot

Return type:

Axes

Returns:

the plot axes. If ax was given, then it is returned; otherwise the new axes is returned.