packages

plot::layer

What an Axes holds: layers, each one mark (a line, markers, bars, an image, ...) with its style. Builders add layers; layout reads them.

Structs

BoxStatsSource

pub struct BoxStats

A box plot's numbers for one group.

nabi
assert(plot::stat::box_stats([1.0, 2.0, 3.0]).median == 2.0);

StyleSource

pub struct Style

The style of a layer. color none takes the next cycle colour.

nabi
assert(plot::line([0, 1], [0, 1]).width(2.0).len() == 1);

LayerSource

pub struct Layer

One layer of an Axes.

nabi
assert(plot::bar(["a"], [1]).len() == 1);

Enums

MarkerSource

pub enum Marker

A marker shape. Every shape is a filled outline, so it can take an edge colour too.

nabi
assert((try plot::scatter([0, 1], [0, 1]).marker(plot::Marker::Star).svg()).contains("<path"));

DashSource

pub enum Dash

A line's dash pattern.

nabi
let ax = plot::line([0, 1], [0, 1]).dash(plot::Dash::Pattern([4.0, 1.0, 1.0, 1.0]));
assert((try ax.svg()).contains("stroke-dasharray"));

StepAtSource

pub enum StepAt

Where a step plot changes value: at x[i] going right (Post, the value holds until the next point), before it (Pre), or halfway (Mid).

nabi
assert((try plot::step([0, 1, 2], [1, 2, 1], plot::StepAt::Mid).svg()).contains("<path"));

LocSource

pub enum Loc

Where the legend goes.

nabi
assert((try plot::line([0, 1], [0, 1]).label("a").legend(plot::Loc::Outside).svg()).contains(">a<"));

SideSource

pub enum Side

Which axis a layer is drawn against.

nabi
use plot::layer::Side;

assert(Side::Left != Side::Right);

MarkSource

pub enum Mark

The thing a layer draws.

nabi
let ax = plot::line([0, 1], [0, 1]);
assert(ax.len() == 1);
  • Scatter§

    Source
  • Bars centred at x from base to base + h; width in x units.

  • The region between two curves over x; outline draws y2 as a line on top.

  • ErrorBars§

    Source
  • Violins§

    Source

    Densities dens[i] sampled at at[i] around pos[i].

  • A grid of values over the rectangle extent (x0, x1, y0, y1), row 0 at y0.

  • Contour§

    Source

    Contour lines (or filled bands) of a grid over extent.

  • Quiver§

    Source

    Arrows from (x, y) along (u, v).

  • Text at (tx, ty) with an arrow to (x, y).

  • A horizontal (vertical false) or vertical line across the plot.

  • A band across the plot between lo and hi.