plot::scene
A rendered figure as drawing primitives in px (y down), the one input of every backend. Layout makes it once; SVG writes it, the rasterizer paints it, the terminal approximates it.
Structs
StrokeSource
pub struct StrokeHow a line is drawn.
let s = try plot::line([0, 1], [0, 1]).figure().scene();
assert(s.items.len() > 0);
Dash and gap lengths in px; empty for solid.
Round ends and joins instead of butt ends and miter joins.
RectSource
pub struct RectA clip rectangle.
let r = plot::scene::Rect { x: 1.0, y: 2.0, w: 3.0, h: 4.0 };
assert(r.right() == 4.0 && r.bottom() == 6.0);
The right edge.
nabiassert(plot::scene::Rect { x: 1.0, y: 0.0, w: 2.0, h: 1.0 }.right() == 3.0);The bottom edge.
nabiassert(plot::scene::Rect { x: 0.0, y: 1.0, w: 1.0, h: 2.0 }.bottom() == 3.0);
SceneSource
pub struct SceneA figure ready for a backend.
let s = try plot::line([0, 1], [0, 1]).figure().scene();
assert(s.clips.len() >= 2);
Clip rectangles; entry 0 is the whole figure.
Enums
AnchorSource
pub enum AnchorWhere a text item's x is: at its start, middle or end.
use plot::scene::Anchor;
assert(Anchor::Start != Anchor::End);
ItemSource
pub enum ItemOne drawing primitive. clip indexes Scene::clips, 0 for none.
use plot::scene::Item;
let s = try plot::scatter([0, 1], [0, 1]).figure().scene();
assert(s.items.iter().any(|it| it is Item::Markers));
A filled path (nonzero winding).
A stroked path.
Markers of one shape centred at
(xs[i], ys[i]),sizes[i]px across and filled withfills[i]; a list of one applies to all.Text with its baseline at
y, rotatedrotatedegrees counterclockwise about(x, y).An RGBA image of
colsxrowspixels (top row first) stretched over the rectangle, drawn without smoothing.