bland 0.2.1

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, Stroke};

fn main() {
    // 32-point discrete-time signal: damped sinusoid.
    let xs: Vec<f64> = (0..32).map(|i| i as f64).collect();
    let ys: Vec<f64> = xs
        .iter()
        .map(|n| (-(n / 16.0)).exp() * (n * 0.6).cos())
        .collect();

    let fig = Figure::new()
        .size(PaperSize::A5Landscape)
        .title("Discrete signal x[n]")
        .xlabel("n")
        .ylabel("x[n]")
        .stem(&xs, &ys, |s| {
            s.marker(Marker::CircleFilled).stroke(Stroke::Solid).label("x[n]")
        })
        .hline(0.0, |h| h.stroke(Stroke::Solid))
        .legend_top_right();

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