| Crates.io | splot |
| lib.rs | splot |
| version | 0.10.0 |
| created_at | 2021-07-24 13:23:51.529177+00 |
| updated_at | 2026-01-10 19:32:28.45218+00 |
| description | Plot data to HTML |
| homepage | |
| repository | https://github.com/DougLau/splot |
| max_upload_size | |
| id | 426773 |
| size | 58,590 |
Rust crate for plotting to SVG / HTML
use splot::{Chart, Domain, Edge, Plot};
let data = vec![(13, 74), (111, 37), (125, 52), (190, 66)];
let chart = Chart::new()
.title("Line Plot")
.domain(Domain::from(&data[..]).set_x(&[0.0, 200.0]))
.axis("X Axis", Edge::Bottom)
.axis("Y Axis", Edge::Left)
.plot(Plot::line("Series", &data).label());
print!("{chart}");
use splot::{Chart, Charts, Edge, Plot};
let data_a = vec![(13, 74), (111, 37), (125, 52), (190, 66)];
let data_b = vec![(22, 50), (105, 44), (120, 67), (180, 39)];
let charts = Charts::new().chart(
Chart::new()
.title("Scatter Plot")
.domain(&data_a[..])
.axis("X Axis", Edge::Bottom)
.axis("Y Axis", Edge::Left)
.axis("", Edge::Right)
.plot(Plot::scatter("Series A", &data_a).label())
.plot(Plot::scatter("Series B", &data_b)),
);
print!("{charts}");