1 unstable release

new 0.1.0 Feb 9, 2025

#15 in #semantic-version

MIT/Apache

23KB
434 lines

sakz

Test status License

Fast and simple plotting library.

Installation

cargo add sakz
# If you're using pip:
pip install sakz

# If you're using poetry:
poetry add sakz

# If you're using uv:
uv add sakz

Usage

use sakz;
use sakz::Plot;

use rand::Rng;

fn main() {
    let mut rng = rand::thread_rng();
    let x: Vec<f64> = (0..100).map(|_| rng.gen_range(0.0..10.0)).collect();
    let y: Vec<f64> = (0..100).map(|_| rng.gen_range(0.0..10.0)).collect();
    let data = x.iter().zip(y.iter()).map(|(x, y)| (*x, *y)).collect();

    let mut fig = sakz::Figure::new("Test".to_string(), 2, sakz::CoordinateSystem::Cartesian);
    let mut scatter = sakz::Scatter::new_2d(data);
    scatter.color("#39f").marker_size(3.0);
    _ = fig.plot(&scatter);
    fig.save("example.svg").unwrap();
}

This library is using Semantic Versioning.

Dependencies

~10MB
~178K SLoC