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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use bland::{qq_plot, QqOpts};

fn main() {
    let samples: Vec<f64> = (0..500)
        .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 = qq_plot(&samples, QqOpts::default().label("residuals"));

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