bland 0.1.0

Pure-Rust library for paper-ready, monochrome, hatch-patterned technical plots in the visual tradition of 1960s-80s engineering reports.
Documentation
use bland::{Figure, Marker, PaperSize};

fn main() {
    let xs: Vec<f64> = (1..=8).map(|i| i as f64).collect();
    let ys: Vec<f64> = xs.iter().map(|x| 2.0 * x.ln() + 1.0).collect();
    let yerr: Vec<f64> = xs.iter().enumerate().map(|(i, _)| 0.2 + (i as f64 * 0.05)).collect();

    let fig = Figure::new()
        .size(PaperSize::A5Landscape)
        .title("Mean ± 1σ")
        .xlabel("trial")
        .ylabel("response")
        .errorbar(&xs, &ys, |e| {
            e.yerr(&yerr).marker(Marker::CircleFilled).label("trials ±1σ")
        })
        .legend_bottom_right();

    std::fs::create_dir_all("out").expect("create out/");
    std::fs::write("out/errorbar.svg", fig.to_svg()).expect("write svg");
    println!("wrote out/errorbar.svg");
}