plotkit 0.5.0

A matplotlib-shaped, publication-quality plotting library for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Line plot example — the flagship demo.

fn main() -> plotkit::Result<()> {
    let x: Vec<f64> = (0..100).map(|i| i as f64 * 0.1).collect();
    let y: Vec<f64> = x.iter().map(|&v| v.sin()).collect();

    plotkit::plot(&x, &y)?;
    plotkit::title("sin(x)");
    plotkit::xlabel("x");
    plotkit::ylabel("y");
    plotkit::savefig("examples/output/01_line.png")?;
    Ok(())
}