1 个不稳定版本

0.0.1 2022 年 10 月 2 日

#43#charts

Download history 41/week @ 2024-03-23 18/week @ 2024-03-30 2/week @ 2024-04-06 2/week @ 2024-04-13 9/week @ 2024-04-20 5/week @ 2024-04-27 24/week @ 2024-05-04 5/week @ 2024-05-11 17/week @ 2024-05-18 31/week @ 2024-05-25 16/week @ 2024-06-01 11/week @ 2024-06-08 25/week @ 2024-06-15 2/week @ 2024-06-22

每月 54 次下载
twang 中使用

MIT/Apache

40KB
1K SLoC

Splotch

在文件中绘制数据

文档


lib.rs:

在文件中绘制数据

示例线图

use splotch::{plot, Chart, Page, axis::{Horizontal, Vertical}};
use pointy::BBox;

let data = vec![(13.0, 74.0), (111.0, 37.0), (125.0, 52.0), (190.0, 66.0)];
let domain = {
    let mut domain = BBox::new(data.iter().cloned());
    domain.extend([0.0, 200.0]);
    domain
};
let plot = plot::Line::new("Series", &domain, &data);
let page = Page::default().with_chart(
    Chart::default()
        .with_title("Line Plot")
        .with_axis(Horizontal::new(domain).with_name("X Axis Name"))
        .with_axis(Vertical::new(domain).with_name("Y Axis Name").on_right())
        .with_plot(&plot),
);
println!("{}", page);

依赖项

~470KB