packages

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 PlotError

What went wrong while rendering or saving a figure.

nabi
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"));
  • Length§

    Source

    Data series of one layer whose lengths differ; what names them.

  • A layer or a grid with no values where it needs some.

  • A colour string that is not #rgb, #rrggbb, #rrggbbaa, a name, or C0 to C9.

  • A value the axis scale cannot show: zero or a negative number on a log axis, NaN limits, a reversed range.

  • Argument§

    Source

    An argument out of its range (a negative width, zero bins, a grid with ragged rows); what says which.

  • Column§

    Source

    A table column that is missing or not numeric (frame module); what names it and what the table has.

  • A file could not be written; what is the path and the reason.

Trait implementations 2
  • impl Display for PlotError
  • impl Error for PlotError