This is an automated archive made by the Lemmit Bot.
The original was posted on /r/rust by /u/Sc2Ryan on 2025-06-29 00:49:23+00:00.
🪶 Introducing Quill: A Lightweight 2D Rust Plotting Library
I built quill because I was unhappy with the current plotting options for creating simple, but great looking, 2D plots for examples or reports. I the other options for example Plotters had a difficult API for simple tasks and added dramatically to compilation times not to mention the majority of plotting libraries I found are meant for embedded or web applications. I built this mainly to serve as a .svg plot generator for my differential-equations library’s examples but I think this will be useful for others hence why I am sharing!
use quill::*;
let data = (0..=100).map(|x| {
let xf = x as f64 * 0.1;
(xf, xf.sin())
}).collect();
let plot = Plot::builder()
.title("Sine Wave".to_string())
.data(vec![
Series::builder()
.name("sin(x)".to_string())
.color("Blue".to_string())
.data(data)
.line(Line::Solid)
.build(),
])
.build();
plot.to_svg("sine.svg").unwrap();
Everything from gridlines to legends are modifiable using the builder pattern thanks to bon!
In the future I would like to add other chart types but for now only 2D Line/Scatter plots are supported.
Repository: https://github.com/Ryan-D-Gast/quill