Library / SDK
plotters-rs/plotters avatar
plotters-rs/plotters

Plotters for Rust: bitmap and SVG backends in-tree, everything else split out

A rust drawing library for high quality data plotting for both WASM and native, statically and realtimely 🦀 📈🚀

4,652 stars320 forksRustMIT

At a glance

What is it?
Plotters is a pure Rust library for drawing charts to bitmaps, SVG, a WebAssembly canvas and a few windowing toolkits. It is a drawing crate, not a printer driver, and several of its backends now live in other repositories.
Who is it for?
Use Plotters when you want charts drawn from Rust code to PNG, SVG or an HTML5 canvas without leaving the language. Skip it if you need a terminal chart backend, a polished guide today, or hardware plotter control.
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?
Activity is slowing. The repository last received commits 7 months 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 November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • plotters-rs/plotters4,652 ★ · +23
Star history
Repository2026-09-232026-11-22
plotters-rs/plotters4.6k4.7k

23 Stars in the last 60 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Two backends stay in this workspace and the rest were moved out

The Cargo workspace lists four members: plotters, plotters-backend, plotters-bitmap and plotters-svg. Only plotters is a default member, so a plain build from the repository root builds the main crate. The split matters because the drawing code and the output targets are separate crates: plotters-backend holds what a backend must implement, while plotters-bitmap and plotters-svg are the two renderers that remain in this tree.

The project says it has moved some backend code to separate repositories. The gallery links to a piston example under plotters-piston, and the demo list points to separate plotters-minifb-demo, plotters-gtk-demo and plotters-wasm-demo repositories. If you came for the piston window or GTK and Cairo backends mentioned in the introduction, you will not find their source in this checkout. Read the FAQ list in the README before you go looking for the code, and expect to track more than one repository when you pin versions.

Text rendering needs freetype and fontconfig development headers on Linux

Chart captions and axis labels go through font handling, and the project lists system packages to install first. On Ubuntu:

code
sudo apt install pkg-config libfreetype6-dev libfontconfig1-dev

On Fedora:

code
sudo dnf install pkgconf freetype-devel fontconfig-devel

No instructions are given for other distributions or for Windows and macOS in the part of the README that is available, so on those systems you work out the equivalent packages yourself. A fresh CI image or a minimal container is where this bites: the build fails at the link or discovery step until pkg-config can find the two libraries. There is also a section titled Reducing Depending Libraries and Turning Off Backends, which exists because the default feature set pulls in more than a small program may want.

The quick start only works after you create plotters-doc-data by hand

Adding the crate is one line in Cargo.toml:

toml
[dependencies]
plotters = "0.3.3"

The next instruction is easy to miss. You must create the subdirectory plotters-doc-data inside your Cargo project directory, because the sample in src/main.rs writes the chart to plotters-doc-data/0.png. Cargo will not make that folder for you, so a program that points a BitMapBackend at a missing directory has nowhere to write its file.

The example draws y=x^2. It creates a BitMapBackend with the path and a size of 640 by 480, turns it into a drawing area, fills it with WHITE, and builds a chart with a caption, a margin of 5 and label area sizes of 30 on both axes. The coordinate system comes from build_cartesian_2d with ranges of -1 to 1 on x and -0.1 to 1 on y. A mesh is drawn with configure_mesh, and the curve is added with draw_series and a LineSeries.

Five layers separate where pixels go from what is drawn

The documentation walks through the library as a stack, and the quick start code shows each layer once. A drawing backend is the target: bitmap, SVG, piston window, GTK/Cairo or WebAssembly. A drawing area is a region carved out of that backend, which is what into_drawing_area returns. Elements are the things drawn on the area, and composable elements combine them. The chart context, built by ChartBuilder, binds a drawing area to coordinate ranges and lets you call methods like configure_mesh and draw_series.

This layering has a real consequence. Because the chart logic does not know which backend it is on, the same series code can render to a PNG file or to an HTML5 canvas by swapping the backend at the root. The cost is verbosity: a simple line chart needs a backend, an area, a builder, a mesh and a series, each as a separate step, and each returns a Result that the example propagates with the question mark operator.

Console plotting has internal code but no finished backend

The project states that all internal code for console plotting is ready, but a console based backend is still not ready. That gap is stated plainly, and it is the clearest thing the library cannot do today if you wanted charts printed in a terminal.

What exists is an example, console.rs, showing how to plot on the console with a customized backend. In practice that means you write the character-grid renderer yourself against the backend interface from plotters-backend. If you only need a quick sparkline in a CLI tool, that is a lot of work compared with picking a ready backend. The same example file appears twice in the gallery, so there are screenshots, but a gallery picture does not make it a supported feature.

Jupyter and WebAssembly each need an explicit opt-in

Plotters can draw interactively in a Jupyter Notebook through evcxr. The feature named evcxr must be enabled when you include Plotters in the notebook, so a notebook cell that adds the crate without that feature will not give you inline plots. The project links an interactive notebook and a static HTML version of it.

For the browser there is a section titled Plotting on HTML5 canvas with WASM Backend, a live WASM example page and the separate plotters-wasm-demo repository. WebAssembly is a first-class target in the project description, which says the library is for both WASM and native, statically and in real time. The gallery also lists an animation example and a cpustat example in the piston repository, but the available text does not say how well either performs, so treat any speed expectation as something to measure yourself.

The last push was 2026-04-13 and there are no GitHub releases

The repository is not archived, but its most recent push was on 2026-04-13, more than six months before this was written, so it cannot honestly be called actively maintained. There are no GitHub releases to read. Version history lives in CHANGELOG.md and RELEASE-NOTES.md at the top of the repository, and the quick start pins plotters = "0.3.3".

The developer guide is described as a work in progress, with only a preview published. The practical advice is to open the rustdoc and the examples directory first, since the guide may still change shape. Confirm the current crates.io version yourself before copying the 0.3.3 line, because a pinned example in a README is a snapshot, not a statement about what is newest. The license is MIT, and the project homepage is plotters-rs.github.io/home.

Editorial conclusion

Use Plotters when you want charts drawn from Rust code to PNG, SVG or an HTML5 canvas without leaving the language. Skip it if you need a terminal chart backend, a polished guide today, or hardware plotter control. Before adopting, check crates.io for the current version, because the last push was 2026-04-13 and the repository has no GitHub releases.

Frequently asked questions

How do you use Plotters in a Rust project?

Add plotters = "0.3.3" under [dependencies] in Cargo.toml, create a plotters-doc-data subdirectory, and run the sample that draws y=x^2 to plotters-doc-data/0.png. On Ubuntu and Fedora install the freetype and fontconfig development packages first.

What is Plotters?

Plotters is a pure Rust drawing library for rendering figures, plots and charts. It supports bitmap, vector graph, piston window, GTK/Cairo and WebAssembly backends.

What is Plotters in computer terms?

Here it is software, not hardware: a Rust crate that draws charts from code. It is a library you add to a Cargo project, and it has no connection to plotter printers.

Official sources

  1. Issues
  2. License: MIT
  3. plotters-rs/plotters on GitHub
  4. Project website
  5. README
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.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/plotters-rs-plotters.svg)](https://hysenlabs.com/projects/plotters-rs-plotters)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/plotters-rs-plotters.svg)](https://hysenlabs.com/projects/plotters-rs-plotters)

Was this useful?