zabgrab.ui.plot

Drawing plots with matplotlib (the optional plot extra).

matplotlib is imported only when a plot is drawn, so zabgrab works without it.

Functions

draw(spec, tz, *[, interactive])

Draw a plot.

show_or_save(spec, tz[, outputs])

Show a plot in a window, or save it to files.

zabgrab.ui.plot.draw(spec, tz, *, interactive=False)[source]

Draw a plot.

Parameters:
Returns:

matplotlib.figure.Figure – One subplot per axis in spec, sharing the time axis.

Return type:

Figure

zabgrab.ui.plot.show_or_save(spec, tz, outputs=())[source]

Show a plot in a window, or save it to files.

Parameters:
  • spec (PlotSpec) – What to draw.

  • tz (tzinfo or None) – The time zone to show times in (None for local time).

  • outputs (sequence of Path, optional) – The image files to save to (each one’s extension picks its format, e.g. .png, .pdf or .svg). If none are given, the plot is shown in a window.

Raises:

ZabgrabError – If matplotlib isn’t installed, or a file can’t be written.

Return type:

None