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, Normalize, PaperSize};

fn main() {
    let samples: Vec<f64> = (0..2000)
        .map(|i| {
            let u1 = (i as f64 * 0.732 + 0.31) % 1.0;
            let u1 = u1.max(1e-9);
            let u2 = (i as f64 * 1.197 + 0.71) % 1.0;
            (-2.0 * u1.ln()).sqrt() * (2.0 * std::f64::consts::PI * u2).cos()
        })
        .collect();

    let fig = Figure::new()
        .size(PaperSize::Letter)
        .title("Empirical CDF — standard normal samples")
        .xlabel("z")
        .ylabel("F(z)")
        .histogram(&samples, |h| {
            h.bins(50).normalize(Normalize::Cmf).label("F(z)")
        })
        .hline(0.5, |h| h.stroke(bland::Stroke::Dotted))
        .legend_top_left();

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