plot::error
The one error type of the package. Builders never throw: what they cannot check yet (a colour name, data lengths, a log axis over zero) is checked when the figure is rendered, and the message says what to write instead.
Enums
PlotErrorSource
pub enum PlotErrorWhat went wrong while rendering or saving a figure.
use plot::PlotError;
let e = try {
_ = try plot::line([1.0, 2.0], [1.0]).svg();
PlotError::Empty { what: "" }
} catch e: PlotError { e };
assert(f"{e}".contains("2 x values and 1 y values"));
Data series of one layer whose lengths differ;
whatnames them.A layer or a grid with no values where it needs some.
A colour string that is not
#rgb,#rrggbb,#rrggbbaa, a name, orC0toC9.A value the axis scale cannot show: zero or a negative number on a log axis, NaN limits, a reversed range.
An argument out of its range (a negative width, zero bins, a grid with ragged rows);
whatsays which.A table column that is missing or not numeric (
framemodule);whatnames it and what the table has.A file could not be written;
whatis the path and the reason.
Trait implementations 2
impl Display for PlotErrorimpl Error for PlotError