A Rust crate for charts and figures with bitmap, SVG, window, and WebAssembly backends, including line, point, candlestick, and histogram series.
Overview
Plotters is a Rust drawing library focused on data visualization for native programs and WebAssembly. It renders figures through pluggable backends such as bitmap files, SVG, desktop windows, and HTML5 canvas when compiled to WASM.
The API centers on drawing areas, composable elements, and chart contexts rather than a fixed charting grammar. Built-in series types include lines, points, candlesticks, and histograms, and multiple charts can be composed into one image. Developers can define custom elements and coordinate systems.
Features are gated in Cargo so consumers can disable default backends and dependencies, limiting builds to SVG-only or other subsets. Optional integrations include Jupyter via evcxr, date-time coordinates through chrono, and serde serialization. Bitmap output can encode PNG and related formats when enabled.
Documentation and examples cover static rendering, realtime updates, and interactive notebook workflows. Backend implementations for some targets live in separate crates linked from the project FAQ.
Key features
- Bitmap and SVG backends
- WebAssembly canvas backend
- Line, point, and histogram series
- Candlestick chart support
- Composable drawing areas
- Custom elements and coordinates
- Optional Jupyter evcxr integration
- Feature-gated dependencies
Use cases
- Render scientific plots in Rust
- Export chart images in CI
- Interactive plotting in notebooks
- Browser charts via WASM
- Realtime figure updates