Registry / utility / plotters

plotters

JSON →
library0.3.7rscratesunverified

A Rust drawing library focused on data plotting for both WASM and native applications.

# Cargo.toml [dependencies] plotters = "0.3.7"
INSTALL
IMPORT
SIG · PLOTTERS
P
plotters
utilityrustv0.3.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ChartBuilder
use plotters::prelude::*;

Creates an SVG plot of y=x^2 with axes and labels.

use plotters::prelude::*; fn main() -> Result<(), Box<dyn std::error::Error>> { let root = SVGBackend::new("plot.svg", (640, 480)).into_drawing_area(); root.fill(&WHITE)?; let mut chart = ChartBuilder::on(&root) .caption("y=x^2", ("sans-serif", 50).into_font()) .margin(20) .x_label_area_size(30) .y_label_area_size(30) .build_cartesian_2d(-1f32..1f32, -0.1f32..1f32)?; chart.configure_mesh().draw()?; chart.draw_series(LineSeries::new( (-50..=50).map(|x| x as f32 / 50.0).map(|x| (x, x * x)), &RED, ))?; Ok(()) }
Debug
Known issues
gotchaPlotters has multiple backends (SVG, bitmap, etc.) that require enabling corresponding feature flags.
fix
Add features like `svg_backend` or `bitmap_backend` to your Cargo.toml dependency.
affects: >=0.3.0
Upgrade
Version history
0.3.7latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
plotters — cargo add plotters · libregistry