Plotters: A Rust Drawing Library for Native and WebAssembly Charts
A rust drawing library for high quality data plotting for both WASM and native, statically and realtimely 🦀 📈🚀
At a glance
- What is it?
- Plotters is a pure Rust library for rendering data plots and charts on both native targets and WebAssembly. It separates drawing logic from output format through a pluggable backend system, supporting bitmap files, SVG, GTK/Cairo windows, Piston windows, and HTML5 canvas via WASM, all from the same chart-building API.
- Who is it for?
- Rust engineers who need to produce charts in a native binary, a WebAssembly module, or a GTK application without calling into a Python or JavaScript runtime will find Plotters covers that ground. The library is well-suited to offline chart generation, embedded tooling, and CLI utilities that output PNG or SVG.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 171 days ago.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What Plotters Solves and Who Should Use It
Most data visualisation libraries run in Python or JavaScript. Engineers working in Rust who want to produce charts face two choices: call out to a separate process running matplotlib, or use a library that compiles into the same binary. Plotters takes the second path. It is a drawing library written entirely in Rust, with no requirement for a Python or JavaScript runtime.
The primary audience is Rust engineers building command-line tools, data pipelines, or Rust-native applications that need to output charts as PNG files or SVG documents. A secondary audience is WebAssembly developers who want to render charts inside a browser without importing a large JavaScript charting library.
Plotters is not a data analysis library. It does not compute statistics, fit models, or manipulate data frames. It handles the rendering step only: take data coordinates, draw them onto a backend surface.
The Backend Model: One API, Multiple Output Surfaces
Plotters separates the chart-building API from the output format through an abstract backend trait. Any type that implements the DrawingBackend trait can serve as the output surface. The repository ships several backends as separate crates inside the workspace.
The workspace is organised as four crates: plotters (the main library and default backends), plotters-backend (the abstract trait), plotters-bitmap (bitmap output using the image crate), and plotters-svg (SVG string output). Additional backends such as the GTK/Cairo backend and the Piston window backend have been moved to separate repositories, as the README notes in the FAQ list.
This separation has a practical consequence: reducing compile time and binary size is possible by disabling backends you do not need. The README mentions that the list of available features controls which backends are compiled in.
Adding Plotters to a Rust Project
On Ubuntu, the bitmap backend requires system libraries for font rendering. Install them with:
sudo apt install pkg-config libfreetype6-dev libfontconfig1-devOn Fedora, the equivalent command is:
sudo dnf install pkgconf freetype-devel fontconfig-develAdd the library to Cargo.toml:
[dependencies]
plotters = "0.3.3"Create the output directory the quick-start example uses:
mkdir plotters-doc-dataThe following code from the README draws a quadratic function and writes it to plotters-doc-data/0.png:
use plotters::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let root = BitMapBackend::new("plotters-doc-data/0.png", (640, 480)).into_drawing_area();
root.fill(&WHITE)?;
let mut chart = ChartBuilder::on(&root)
.caption("y=x^2", ("sans-serif", 50).into_font())
.margin(5)
.x_label_area_size(30)
.y_label_area_size(30)
.build_cartesian_2d(-1f32..1f32, -0.1f32..1f32)?;
chart.configure_mesh().draw()?;ChartBuilder configures the axes and caption. The configure_mesh call draws the grid lines and axis labels.
Chart Types and the Drawing Model
Plotters supports a range of chart types. The README gallery lists line charts, histograms, scatter plots, area charts, candlestick charts (for stock data), error bars, box plots, 3D plots, matrix visualisations, and fractal drawings. Animation is also shown in the gallery through the animation example.
The drawing model is built from five concepts. Drawing backends provide the output surface. Drawing areas partition the surface into sub-regions. Elements are the primitive shapes (text, lines, rectangles, circles). Composable elements combine primitives into reusable shapes. Chart contexts are high-level builders that wire data ranges to axes and series.
The LineSeries, HistogramSeries, and similar types map data iterators to drawn marks. This separation means Plotters works with any Rust iterator that yields coordinate pairs, without requiring a specific data container type.
WebAssembly Support and Its Practical Limits
The README lists WebAssembly as a first-class target alongside native platforms. The WASM backend renders charts on an HTML5 canvas element. A live demo is hosted at plotters-rs.github.io/wasm-demo/www/index.html, and a dedicated demo repository (plotters-wasm-demo) shows the integration.
Plotters also integrates with the evcxr Jupyter kernel. The README states that the evcxr feature must be enabled when including Plotters in a Jupyter notebook, allowing charts to appear interactively inside notebook cells.
The console plotting backend is the main area where the library is incomplete. The README states that the internal code is ready for console plotting but a console-based backend is not yet released. A console.rs example in the repository shows how to plot on a console with a customised backend, but this requires writing a custom backend rather than using a built-in one.
Genuine Limitations
Plotters does not provide high-level statistical chart types such as violin plots, density estimates, or regression overlays. The library handles rendering, not computation, so producing those charts requires computing the underlying data points in Rust before passing them to Plotters.
The library has no GitHub releases. Version 0.3.3 is available on crates.io, but there is no release tag history on the GitHub repository to anchor changelogs or semantic version bumps. Engineers who need to track breaking changes must read CHANGELOG.md and RELEASE-NOTES.md in the repository directly.
The bitmap backend's system library dependencies (freetype and fontconfig) add friction in environments like Alpine-based Docker images or Windows cross-compilation setups, where those libraries may not be available or may require manual configuration. The README documents the Linux install commands but does not document a Windows-native font setup.
How Plotters Compares to Matplotlib
Matplotlib is a Python library for data visualisation that integrates with NumPy and pandas. It runs in Python and is the standard choice for interactive exploration in Jupyter notebooks. Its strength is tight coupling with the Python data science stack.
Plotters is the Rust-native option for projects where Python is not part of the stack. It compiles into the same binary as the rest of a Rust program, with no subprocess or FFI call to Python. The trade-off is that Plotters lacks the extensive gallery of chart types and the large ecosystem of third-party extensions that Matplotlib has accumulated.
For a Rust command-line tool that needs to embed chart generation, Plotters removes the dependency on a Python installation. For interactive data exploration or scripts where Python is already in use, Matplotlib is the more capable and better-documented choice.
Maintenance Status and Licence
The last push to the repository was on 2026-04-13. The repository is not archived. There are no GitHub releases; consumers use the crates.io publication. The licence is MIT.
The repository provides a CHANGELOG.md and RELEASE-NOTES.md for version history. A CONTRIBUTING.md describes the process for sending patches. The developer's guide is listed as a work in progress with a preview hosted at plotters-rs.github.io/book.
Editorial conclusion
Rust engineers who need to produce charts in a native binary, a WebAssembly module, or a GTK application without calling into a Python or JavaScript runtime will find Plotters covers that ground. The library is well-suited to offline chart generation, embedded tooling, and CLI utilities that output PNG or SVG. Engineers who need interactive, browser-native charts with pan and zoom, or who work primarily in Python, will find matplotlib or a dedicated charting framework more practical. The last push was on 2026-04-13. There are no GitHub releases, so consumers must pin to a specific crates.io version or commit.
Frequently asked questions
Does Plotters support WebAssembly?
Yes. Plotters includes a WASM backend that renders charts on an HTML5 canvas element. The README links to a live WASM demo and a dedicated wasm-demo repository showing the integration.
What chart types does Plotters support?
The README gallery shows line charts, histograms, scatter plots, area charts, candlestick charts, error bars, box plots, 3D plots, matrix visualisations, and animated charts. Plotters handles rendering only and does not compute statistical summaries.
Is the Plotters console backend available?
The README states that the internal code for console plotting is ready but a console-based backend is not yet released. A console.rs example in the repository shows how to plot on a console using a custom backend.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/plotters-rs-plotters)