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 BoxStatsA box plot's numbers for one group.
assert(plot::stat::box_stats([1.0, 2.0, 3.0]).median == 2.0);
StyleSource
pub struct StyleThe style of a layer. color none takes the next cycle colour.
assert(plot::line([0, 1], [0, 1]).width(2.0).len() == 1);
LayerSource
pub struct LayerOne layer of an Axes.
assert(plot::bar(["a"], [1]).len() == 1);
Enums
MarkerSource
pub enum MarkerA marker shape. Every shape is a filled outline, so it can take an edge colour too.
assert((try plot::scatter([0, 1], [0, 1]).marker(plot::Marker::Star).svg()).contains("<path"));
DashSource
pub enum DashA line's dash pattern.
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"));
Dash and gap lengths in multiples of the line width.
StepAtSource
pub enum StepAtWhere a step plot changes value: at x[i] going right (Post, the
value holds until the next point), before it (Pre), or halfway
(Mid).
assert((try plot::step([0, 1, 2], [1, 2, 1], plot::StepAt::Mid).svg()).contains("<path"));
LocSource
pub enum LocWhere the legend goes.
assert((try plot::line([0, 1], [0, 1]).label("a").legend(plot::Loc::Outside).svg()).contains(">a<"));
The corner or edge that covers the fewest data points.
Outside the plot area, right of it.
SideSource
pub enum SideWhich axis a layer is drawn against.
use plot::layer::Side;
assert(Side::Left != Side::Right);
MarkSource
pub enum MarkThe thing a layer draws.
let ax = plot::line([0, 1], [0, 1]);
assert(ax.len() == 1);
Bars centred at
xfrombasetobase + h;widthin x units.The region between two curves over
x;outlinedrawsy2as a line on top.Densities
dens[i]sampled atat[i]aroundpos[i].A grid of values over the rectangle
extent(x0, x1, y0, y1), row 0 aty0.Contour lines (or filled bands) of a grid over
extent.Arrows from
(x, y)along(u, v).Text at
(tx, ty)with an arrow to(x, y).A horizontal (
verticalfalse) or vertical line across the plot.A band across the plot between
loandhi.