Skip to main content

Module plot

Module plot 

Source
Expand description

oa::plot — matplotlib-style retained figure and axes.

The module is a thin layout + replay layer over the engine’s GPU compositor. Three terminal sinks are provided:

ⓘ
let mut fig = plot::Figure::new(plot::FigureConfig { rows: 2, cols: 2, ..Default::default() });
fig.ax(0, 0).plot(&loss_data, Default::default());
fig.ax(0, 1).imshow(texture);
fig.save_to(&engine, "out.png")?;   // headless file sink
let img = fig.render_on(&engine)?;     // → oa::Image
fig.show_on(&engine)?;                 // interactive window

Compact surface: raster bases plus ordered line, scatter, bar, and histogram artists share the same GPU-composed replay.

Donor reference: oa/ui/plot/plot.h

Re-exports§

pub use axes::Axes;
pub use axes::BarStyle;
pub use axes::BoxStyle;
pub use axes::HeatmapStyle;
pub use axes::LineStyle;
pub use axes::Scale;
pub use axes::ScatterStyle;
pub use axes::TickFormat;
pub use figure::Figure;
pub use figure::FigureConfig;
pub use figure::Theme;
pub use view::FigureView;
pub use view::FigureViewState;

Modules§

axes
oa::plot::Axes — one subplot inside an oa::plot::Figure.
figure
oa::plot::Figure — top-level container for a grid of oa::plot::Axes.
view
oa::plot::FigureView — interactive ViewerLiveSource for a retained Figure.