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 a plot. |
|
Show a plot in a window, or save it to files. |
- zabgrab.ui.plot.draw(spec, tz, *, interactive=False)[source]¶
Draw a plot.
- Parameters:
spec (PlotSpec) – What to draw (see
zabgrab.services.plotting.plot_spec()).tz (tzinfo or None) – The time zone to show times in (
Nonefor local time).interactive (bool, optional) – Whether the figure will be shown in a window.
- 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 (
Nonefor local time).outputs (sequence of Path, optional) – The image files to save to (each one’s extension picks its format, e.g.
.png,.pdfor.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