Skip to content
Projects

About

Fast plotting for Rust, Python, JavaScript and C/C++: 120+ chart types, 3D, maps, live windows, grammar of graphics. Benchmarked against matplotlib and plotters.

Creative & Media

How these counts are measured

36 stars2 Forks +1 in 24h

Measured star growth

in 24h
+1
in 7 days
+3
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

DataViz 🚀

crates.io docs.rs crates.io downloads PyPI PyPI downloads npm npm downloads

CI Python CodeQL OpenSSF Scorecard MSRV License: MIT GitHub stars

Fast plotting for Rust, Python, JavaScript and C/C++: 120+ chart types, interactive windows, live data, 3D, maps and a grammar of graphics. Renders charts 8–50× faster than matplotlib in these benchmarks (with a much smaller API: see differences), and faster than the other Rust plotting libraries in nearly every measurement.

let mut fig = Figure::new(900, 500);
fig.axes().line(&x, &y).label("signal");
fig.save("signal.png")?;          // or fig.show() for a live, zoomable window
import dataviz.pyplot as plt      # the common matplotlib calls, not all of them
Zoom, pan and range slider Live dashboard Animation
Maps Finance Math notation

Guide and chart catalog · Live demo in the browser · API docs · Examples

Built with heavy AI assistance (Claude Code); see how it's made.

Why dataviz

  • Fast and lean. Its own rasterizer draws straight into the output buffer: a 10-million-point line renders in about 0.1 s with a few MB of extra memory, a live chart redraws in 1–2 ms. 4–50× faster than matplotlib for typical charts (warm runs, imports excluded) (2× for a 100-million-value histogram, 78× for animations), and faster and lighter than plotters, ruviz, kuva and charts-rs in nearly every measurement (numbers below). Optional multi-core and GPU backends. An idle window uses no CPU (it only sends frames that changed).
  • Everything in one crate. 120+ chart types — lines, bars, statistics, heatmaps, contours, 3D, maps, sankey, networks — plus ready-made charts for data scientists (ROC/PR curves, confusion matrices, regression bands, density contours, dendrograms), biologists and clinicians (DNA sequence logos, gene tracks, Manhattan, volcano, clustermaps, single-cell UMAPs, dose-response, Kaplan-Meier, forest plots), engineers (FFT spectra, spectrograms, Bode, Nyquist, Smith charts) and traders (candlesticks, Ichimoku, VWAP, RSI, MACD, volume profile, order book depth, drawdown, Renko), with themes, subplots, shared and broken axes.
  • Interactive and live. fig.show() opens a window with zoom, pan, a crosshair with axis values, hover readouts, legend toggling, a range slider, measurement, selection and linked brushing across plots; fig.show_live() streams data with rolling windows and records it to CSV or a GIF.
  • Every output. PNG, SVG, PDF, JPEG, WebP, interactive HTML (one file, no internet needed: hover, zoom, pan, rotating 3D), animated GIF/PNG/WebP and MP4, the terminal, raw pixels for your own GUI, and the browser via WebAssembly.
  • Text done right. TeX math ($\sigma^2 = \frac{1}{N}\sum x_i^2$) in every label, any language (CJK, Arabic and Hebrew right to left, Hindi, Thai) and color emoji.
  • Accessible. Generated text descriptions for screen readers, color blindness simulation and warnings for colors that look alike.
  • From any language. Rust, Python (with a matplotlib-compatible dataviz.pyplot and an Altair-style dv.plot), JavaScript/npm (React, Svelte), C and C++ (CMake; prebuilt for Linux, macOS, Windows, iOS and Android), and Claude through the MCP server. A grammar of graphics (data, mark, encodings, facets) works in all of them.
  • Pure Rust, few dependencies. No Python, JavaScript, browser, Cairo or system fonts needed (a font is embedded); builds headless and for wasm32.

Quick start

[dependencies]
dataviz = "1"
use dataviz::prelude::*;

fn main() -> Result<(), Error> {
    let x: Vec<f64> = (0..200).map(|i| i as f64 / 20.0).collect();

    let mut fig = Figure::new(900, 500);
    let ax = fig.axes();
    ax.title("Signals").x_label("time [s]").y_label("amplitude");
    ax.line(&x, x.iter().map(|t| t.sin())).label("sin");
    ax.line(&x, x.iter().map(|t| t.cos())).label("cos").dash(Dash::Dashed);
    ax.scatter([1.6, 4.7, 7.9], [1.0, -1.0, 1.0]).label("peaks").marker(Marker::Star).size(12.0);

    fig.save("signals.png")?;   // .svg .pdf .html .jpg .webp .bmp
    fig.show("Signals")?;       // interactive window
    Ok(())
}

Every chart type has a runnable example with code and output in dataviz-examples — see the gallery.

Your data, as it is

Any iterable of numbers works — Vec, slices, ranges, iterators and arrays from other crates, without conversion or features:

ax.line(&x, &y);                                   // Vec<f64>, &[f32], i64, …
ax.line(&array1, &array1.mapv(f64::sin));          // ndarray
ax.line(&times, polars_df.column("price")?.f64()?); // Polars (nulls become gaps)
ax.scatter(arrow_x.values(), &arrow_y);            // Arrow Float64Array
let t = dataviz::plot::data::Table::read("data.csv")?;   // CSV/TSV, quoted fields
ax.line(t.time_column("date").unwrap(), t.column("close").unwrap());

Features

Interactive windows and live data

fig.show("title")?;                          // static data
fig.show_live("title", 30, |fig| { /* push new points */ true })?;
Mouse / key Action
wheel, drag, right-drag zoom around the cursor, pan, zoom to a box
crosshair (C) cursor values on the axes and every series' value at that x; linked across plots sharing x
hover (H) nearest data point
click a legend row hide or show the series
range slider drag to pan, drag its edges to zoom
Shift+drag / Ctrl+drag measure Δx, Δy and % / select a box (fig.selection())
A, R auto scale y to the visible data, follow live data again
S, Shift+S, Ctrl+C, V save PNG, SVG/PDF, copy to the clipboard, record a GIF
3D: drag, wheel, X/Y/Z turn the scene, zoom, rotate 15° around that axis (Shift = reverse)
T, L, F, Backspace draw a trend line, a price level, a Fibonacci retracement; take back the last drawing

Live charts keep the view you zoomed to while data arrives (y follows the visible data), stream with Line::push / keep_last / keep_since, and plot::data::CsvLog records the stream to CSV. The same zoom, pan, hover and click work in your own GUI or web page through fig.zoom_at, pan_by, hover, click (egui, WebAssembly).

Grammar of graphics

Charts can also be described the way Vega-Lite, ggplot2 and Altair do it: data, a mark (point, line, area, bar, rect, boxplot) and encodings. The color groups, legends, aggregation, histograms, stacking and small multiples follow from the encodings. This works from Rust, from JSON specs, from Python, JavaScript and C, and through the MCP server:

use dataviz::plot::grammar::{Chart, Data, Field, Aggregate, Mark};
let data = Data::new().text("species", &species).num("mass", &mass).text("island", &island);
Chart::new(data, Mark::Bar)
    .x("island")
    .y(Field::new("mass").aggregate(Aggregate::Mean))
    .color("species")
    .draw(&mut fig)?;
{"data": [{"species": "Adelie", "mass": 3750, "island": "Biscoe"}, …],
 "mark": "point", "encoding": {"x": "flipper", "y": "mass", "color": "species", "facet": "island"}}

Chart types

Category Charts
Lines & areas line, step, smooth spline, area, fill-between, stacked / 100 % area, streamgraph, horizon chart, function plot, sparkline
Points scatter, colormapped scatter, bubble
Bars vertical, horizontal, grouped, stacked, percent, overlay, value labels, waterfall, Gantt, lollipop, bullet, dumbbell, Pareto
Distributions histogram (bin rules, density, cumulative, step), KDE, ECDF, box (notches), violin, raincloud, strip, swarm, ridgeline, Q-Q, 2D histogram, hexbin
Uncertainty & fits error bars, error bands, polynomial regression with R², moving averages
Machine learning ROC curve (AUC), precision-recall curve, confusion matrix, SHAP summary, calibration curve, learning curve, cumulative gain and lift, regression with confidence band, LOESS, 2D density contours, dendrogram, UpSet plot
Biology & medicine 3D DNA double helix, molecules from PDB/XYZ (ball-and-stick, sticks, space-filling, backbone, cartoon), Ramachandran plot, isosurfaces of volumes, 3D cells and organoids, 3D UMAP, Circos, Hi-C contact map, coverage track, phylogenetic trees (Newick; rectangular, circular), oncoprint, mutation lollipop, DNA/protein sequence logo, gene track, Manhattan plot, p-value Q-Q, volcano plot, MA plot, clustermap, single-cell embedding (UMAP/t-SNE), dose-response (IC50), Kaplan-Meier survival, forest plot
Signals & control FFT spectrum, spectrogram, 3D waterfall, Bode plot, Nyquist plot, Smith chart, streamlines, SPC control chart
Finance & trading candlestick, OHLC, Heikin-Ashi, Renko, footprint (order flow), market profile (TPO), liquidity heatmap, option payoff (Black–Scholes), implied volatility surface, Bollinger bands, Ichimoku cloud, VWAP, RSI, MACD, Stochastic, ATR, volume profile, order book depth, drawdown, trading-day axis
Grids & fields heatmap, correlation matrix, calendar heatmap, image, contour lines and fills, quiver
3D surface, wireframe, scatter, line, spheres, meshes, ellipsoids, isosurfaces, vectors, bars, text; one shared scene per plot with depth sorting, lighting, perspective and free rotation around x, y and z
Maps built-in world map and the states/provinces of every country, choropleth by ISO code or name, points, great-circle routes and flow maps, hexbin density maps, web-map tile basemaps (OpenStreetMap), GeoJSON shapes; Robinson, Natural Earth, Equal Earth, Mollweide, equirectangular, Mercator, orthographic globe, Albers and Lambert conic, stereographic, azimuthal equal-area
Parts of a whole pie, donut, treemap, sunburst, waffle, marimekko (mosaic), funnel, gauge
Polar polar line/scatter, radar, rose / wind rose
Relations & flows sankey, chord diagram, network graph (force-directed), parallel coordinates, slope chart, bump chart, ternary diagram
Layouts subplots with spans, shared axes, broken axes, secondary y-axis, facets (small multiples), pair plot, aligned panels
Annotations text, arrows, reference lines, shaded spans, rectangles

For data scientists

ax.roc_curve("gradient boosting", &labels, &scores);    // legend shows the AUC
ax.pr_curve("gradient boosting", &labels, &scores);     // and the average precision
ax.confusion_matrix(["cat", "dog", "bird"], &actual, &predicted, true);
ax.regplot(&x, &y);                                     // fit, 95 % band and R²
ax.density_contour(&x, &y);                             // 2D KDE, millions of points
ax.dendrogram(&names, &features);                       // hierarchical clustering
ax.shap_summary(&features, &shap, &values, 10);         // what drives the model
ax.calibration_curve("model", &labels, &probs, 10);     // Brier score in the legend
ax.learning_curve(&sizes, &train, &validation);
ax.gain_curve("model", &labels, &scores);               // and lift_curve
ax.raincloud([("A", &a), ("B", &b)]);
ax.upset(&sets, 12);                                    // set intersections

For biologists and clinicians

ax.sequence_logo(&aligned_sequences);                   // DNA, RNA or protein motif
ax.gene_track(&genes);                                  // exons, introns, strand
ax.manhattan(&chromosome, &position, &p_values);        // GWAS
ax.volcano(&genes, &log2_fc, &p_values, 1.0, 1e-3, 10); // top 10 genes named
fig.clustermap(&genes, &samples, &expression);          // clustered heatmap
ax.embedding(&umap_x, &umap_y, &cell_types);            // single-cell clusters
ax.dose_response(&concentration, &viability);           // 4PL fit and IC50
ax.kaplan_meier([("control", t1, e1), ("treated", t2, e2)]); // log-rank p
ax.forest_plot(&studies, &hr, &low, &high, 1.0);        // meta-analysis
ax.circos(&chromosomes).track(&chr, &pos, &cn).links(&sv);
ax.hic(matrix, start, bin).domains(&tads);              // contact map as a triangle
ax.coverage(&pos, &depth).min_depth(20.0);
ax.phylo_tree(newick);                                  // or phylo_tree_circular
ax.oncoprint(&genes, samples, &alterations);
ax.mutation_lollipop(393.0, &domains, &mutations);
ax.molecule(Molecule::from_pdb(&pdb)).style(MolStyle::Cartoon);
ax.ramachandran(&phi, &psi);                            // from molecule.phi_psi()
ax.isosurface(&volume, [nx, ny, nz], bounds, level);    // microscopy, CT, densities

3D: rotate around x, y and z

DNA and a cell turning around the z, x and y axes
ax.dna_helix("ATGCGTATAAAAGCC").highlight(5..11, "#ffd400", Some("TATA box"));
ax.molecule(Molecule::from_pdb(&pdb)).style(MolStyle::Backbone).coloring(MolColor::Rainbow);
ax.ellipsoid([0.0, 0.0, 0.0], [10.0, 8.0, 6.0]).opacity(0.16);   // a cell membrane
ax.spheres3d(&x, &y, &z, [1.0]).values(&expression, Colormap::Viridis);
ax.embedding3d(&umap1, &umap2, &umap3, &cell_types);
ax.surface_fn(|x, y| (x * y).sin(), (-3.0, 3.0), (-3.0, 3.0), 60);
ax.rotate(Axis3::X, 30.0).roll(10.0).perspective(0.4);       // or ax.camera(azimuth, elevation)

All 3D series of a plot share one scene, sorted by depth, lit from the upper left and optionally faded with distance (depth_cue). The camera is a rotation matrix, so it turns freely around any axis. In a window: drag to turn, wheel to zoom, X/Y/Z rotate by 15° (Shift+key the other way), R resets, hover names the atom, base pair or point. A frame of the 1BNA DNA structure (486 atoms, ball-and-stick, shaded) takes about 8 ms on one core, a 10 000-point 3D scatter 3 ms; a turning 90-frame GIF of a surface 0.9 s (3D benchmarks in the Performance section).

For engineers

use dataviz::plot::series::signal::{freq_response, logspace};
ax.spectrum(&signal, 8000.0);                           // FFT amplitude spectrum
ax.spectrogram(&signal, 8000.0, 512, 64);               // STFT power in dB
let w = logspace(0.01, 100.0, 400);
fig.bode("plant", &w, &freq_response(&[1.0], &[1.0, 0.4, 1.0], &w));
ax.nyquist(&freq_response(&[1.0], &[1.0, 0.4, 1.0], &w));
ax.smith(&impedances);                                  // normalized z on a Smith chart
ax.streamplot(|x, y| (u(x, y), v(x, y)), (-3.0, 3.0), (-2.0, 2.0), 28);
ax.ternary(&a, &b, &c).names("sand", "silt", "clay");
ax.waterfall3d(&freq, &time, spectra);
ax.control_chart(&measurements);                        // ±3σ, Western Electric rules
ax.pareto(&causes, &counts);
ax.quiver3d(points, vectors);

For traders

let x = ax.trading_axis(&times, "%d %b");               // no weekend gaps
ax.candlestick(&x, &open, &high, &low, &close);
ax.ichimoku(&x, &high, &low, &close);
ax.vwap(&x, &high, &low, &close, &volume);
profile.volume_profile(&close, &volume, 24);            // POC and value area
osc.stochastic(&x, &high, &low, &close, 14, 3);
book.depth_chart(&bids, &asks);
dd.drawdown(&x, &equity);                               // max drawdown in the legend
heat.liquidity_heatmap((t0, t1), (p0, p1), &depth);     // order book over time
of.footprint(bars, 0.25);                               // bid × ask per level
tpo.market_profile(&ranges, 1.0);                       // POC and value area
opt.option_payoff(&legs, (80.0, 120.0), 30.0, 0.22, 0.03);
vol.volatility_surface(&strikes, &maturities, &iv);

Business and editorial

ax.bullet(&kpis, &values, &targets, &ranges);
ax.dumbbell(&names, &before, &after);
ax.slope(&names, &before, &after, "2020", "2025");
ax.bump(&teams, &seasons, &ranks);
ax.waffle(&parts, &shares);
ax.marimekko(&columns, &rows, &values);
ax.chord(&groups, &flows);
ax.streamgraph(&x, &layers);
ax.horizon(&x, &rows);

Statistics and finance

ax.violin([("A", &a), ("B", &b)]);
ax.swarm([("A", &a), ("B", &b)]);
ax.ridgeline(months);                      // (name, values) per row
ax.qq(&values);                            // against the normal distribution
ax.regression(&x, &y, 2);                  // label shows the equation and R²
fig.facet_wrap(groups, 3, |ax, data| { ax.line(&t, data); });
fig.pair_plot([("length", &l), ("weight", &w), ("age", &a)]);

ax.candlestick(&t, &open, &high, &low, &close);
ax.bollinger(&t, &close, 20, 2.0);
rsi_panel.rsi(&t, &close, 14);
macd_panel.macd(&t, &close, 12, 26, 9);

Maps

use dataviz::plot::geo::Projection;
ax.map(Projection::Robinson);
ax.choropleth([("DEU", 83.2), ("TUR", 85.3), ("JP", 124.5), ("Brazil", 203.1)])
    .colorbar("population [M]");
ax.geo_line([28.98, -74.0], [41.01, 40.7]);    // great circle Istanbul → New York
ax.region_map("TUR", [("TR-34", 15.7), ("Ankara", 5.8)]);   // states/provinces (feature `regions`)
ax.geo_flows(&flows, &names);                   // flow map, width by value
ax.geo_hexbin(&lon, &lat);                      // density of millions of points
ax.basemap(lon, lat, 12, tile_dir("tiles"), "© OpenStreetMap contributors");

Country outlines with ISO codes, continent, population and GDP are included (Natural Earth, public domain); geo::read_geojson reads other shapes.

Text: math and any language

ax.y_label(r"$\sigma^2$ [$\mathrm{m^2\,s^{-2}}$]");
ax.text(1.0, 2.0, r"$\int_0^\infty e^{-x^2}\,dx = \frac{\sqrt{\pi}}{2}$");
fig.title("Ventes · 全球销售 · المبيعات · 🚀");

TeX math (scripts, fractions, roots, Greek letters, operators, accents) is typeset in PNG, SVG, PDF and on the GPU alike. Characters missing from the embedded font come from system fonts; right-to-left text is reordered and shaped; color emoji are drawn.

Output

fig.save("chart.png")?;            // also .svg .pdf .jpg .webp .bmp
fig.save("chart.html")?;           // interactive page; 3D plots turn with the mouse
fig.record("wave.gif", 30.0, 120, |fig, i| { /* change the figure */ })?; // .gif .png (APNG) .mp4 .webm
fig.print()?;                      // terminal (colored half blocks or Braille)
fig.render_into(&mut pixels)?;     // RGBA pixels for your own window or texture

Accessibility

let text = fig.alt_text();          // "Sales. Line chart; quarter from …; Series: north (3 to 5); …"
for w in fig.color_warnings() { println!("{w}"); }   // e.g. two series look alike with deuteranopia
pixels.simulate(Cvd::Deuteranopia); // see the chart as people with color blindness do

SVG, PDF and HTML output carry the title and description for screen readers.

Backends

fig.backend(Backend::Auto);                // default: CPU, all cores from 1 megapixel on
fig.backend(Backend::Cpu { threads: 1 });  // least CPU time and memory
fig.backend(Backend::Cpu { threads: 0 });  // all cores: lowest latency without a GPU
fig.backend(Backend::Gpu);                 // `gpu` feature: Vulkan / Metal / DX12 / OpenGL

Performance

Measured against matplotlib (Python) and the Rust libraries plotters, ruviz, kuva and charts-rs: the same charts, separate processes, medians (Intel(R) Core(TM) Ultra 7 255HX, NVIDIA GeForce RTX 5070 Ti Laptop GPU, Linux). Full results, method and the code to rerun them: dataviz-examples/benchmarks.

Compared with matplotlib: 8–53× faster for charts saved to PNG, 28× faster for a live 100 000-point chart, and 178× less memory for 10 M points.

Charts to an 800×600 PNG (one thread, time per chart):

Chart dataviz plotters ruviz kuva charts-rs matplotlib
line, 1 000 points 1.50 ms 1.66 ms 3.60 ms 4.98 ms 11.1 ms 29.3 ms
bar, 20 bars 0.79 ms 0.83 ms 3.90 ms 3.55 ms 2.08 ms 41.8 ms
scatter, 10 000 points 2.12 ms 2.83 ms 4.37 ms 8.53 ms 76.2 ms 37.5 ms
scatter, 100 000 points 9.88 ms 16.6 ms 16.9 ms 17.4 ms 784.5 ms 81.8 ms
line, 100 000 points 2.17 ms 5.91 ms 8.39 ms 28.2 ms 829.7 ms 50.2 ms
histogram, 1 M values 2.06 ms 2.76 ms 30.2 ms 16.1 ms 12.8 ms 49.6 ms

Big data (time / memory above the data itself):

Chart dataviz dataviz all cores plotters ruviz kuva charts-rs matplotlib
line, 10 M points 129.0 ms / +7 MB 103.1 ms / +6 MB 481.9 ms / +315 MB 332.5 ms / +389 MB 2.70 s / +787 MB fails 533.1 ms / +1162 MB
scatter, 10 M points 230.3 ms / +8 MB 181.6 ms / +7 MB 1.53 s / +12 MB 1.23 s / +376 MB 1.56 s / +788 MB fails 5.08 s / +910 MB
histogram, 100 M values 243.5 ms / +7 MB 235.2 ms / +6 MB 264.6 ms / +12 MB 3.64 s / +1915 MB 1.64 s / +1551 MB 1.23 s / +1533 MB 516.6 ms / +13 MB

Live chart (rolling window, one new point and a full redraw per frame; latency p50 / CPU per frame / memory of the process):

Window dataviz 1 thread dataviz all cores dataviz GPU plotters ruviz kuva matplotlib
1 000 points, 800×600 0.77 ms / 0.77 ms / 7 MB 0.49 ms / 2.57 ms / 8 MB 0.67 ms / 0.47 ms / 214 MB 0.65 ms / 0.63 ms / 14 MB 4.66 ms / 4.67 ms / 11 MB 5.26 ms / 5.23 ms / 27 MB 10.1 ms / 10.1 ms / 73 MB
100 000 points, 800×600 2.20 ms / 2.17 ms / 12 MB 2.02 ms / 4.67 ms / 13 MB 2.04 ms / 1.63 ms / 219 MB 5.40 ms / 5.37 ms / 16 MB 34.6 ms / 34.6 ms / 17 MB 47.0 ms / 47.1 ms / 36 MB 62.0 ms / 62.0 ms / 112 MB
1 000 points, 1920×1080 1.69 ms / 1.70 ms / 15 MB 0.77 ms / 5.83 ms / 17 MB 1.39 ms / 1.23 ms / 221 MB 1.48 ms / 1.50 ms / 18 MB 17.4 ms / 17.4 ms / 18 MB 18.0 ms / 18.0 ms / 33 MB 12.4 ms / 12.6 ms / 79 MB
100 000 points, 1920×1080 5.51 ms / 5.53 ms / 18 MB 3.25 ms / 14.1 ms / 20 MB 2.70 ms / 2.53 ms / 225 MB 8.43 ms / 8.43 ms / 21 MB 119.9 ms / 119.9 ms / 28 MB 115.8 ms / 115.8 ms / 42 MB 136.8 ms / 136.8 ms / 177 MB

Animated GIF (800×600, 120 frames; time, file size):

Animation dataviz plotters ruviz matplotlib
whole plot moves 282.0 ms, 1001 KB 1.09 s, 3227 KB 3.00 s, 1741 KB 5.24 s, 1119 KB
line grows on fixed axes 81.0 ms, 38 KB 2.40 s, 3257 KB 2.91 s, 1701 KB 5.75 s, 420 KB

3D charts (800×600 PNG; dataviz, plotters and matplotlib on one core, PyVista on the GPU; a rotation frame is the camera turned and the image drawn again):

Chart dataviz dataviz GPU plotters matplotlib PyVista
surface 60² 6.34 ms 2.37 ms 6.05 ms 57.0 ms 93.7 ms
surface 200² 29.9 ms 5.41 ms 21.3 ms 146.2 ms 101.0 ms
scatter 10,000 2.81 ms 2.00 ms 3.19 ms 96.3 ms 89.2 ms
scatter 1,000,000 147.0 ms 39.9 ms 170.3 ms 5.71 s 119.2 ms
line 100,000 (Lorenz) 9.93 ms 3.79 ms 8.41 ms 59.3 ms 87.8 ms
molecule 1BNA (486 atoms) 3.35 ms 2.31 ms 1.91 ms 37.6 ms 82.1 ms
rotation frame: surface 60² 5.10 ms 0.45 ms 4.98 ms 25.0 ms 0.55 ms
rotation frame: molecule 2.13 ms 0.46 ms 0.88 ms 11.4 ms 0.61 ms
GIF, 90 frames turning 885.7 ms, 3949 KB 665.9 ms, 3453 KB 2.80 s, 4544 KB 7.38 s, 5713 KB 4.14 s, 3441 KB

What makes it fast: the scene is drawn straight into the output buffer by dataviz's own anti-aliased rasterizer; dense lines become one pixel-column envelope and dense scatter plots an occupancy grid, so time and memory stay flat as the data grows; data passed to a series is not copied; glyphs and markers are cached as bitmaps; histograms use SIMD binning. Animations store only the changed part of each frame. On the web the same renderer compiled to WebAssembly draws a 960×520 live chart with 2 × 3 000 points in about 1.7 ms.

In 3D dataviz is 35–52× faster than matplotlib for scatter plots, 5–23× for surfaces and 4–9× for lines, molecules and rotation frames; it draws a turning GIF 3.2× faster than plotters and 7.4× faster than PyVista and is first (on the CPU or the GPU) for both surfaces and for scatter plots up to a million points, with lighting, depth order and anti-aliasing. plotters is faster for the long 3D line and the molecule: it draws 1-pixel lines and flat circles without depth sorting or lighting, while dataviz shades every atom as a lit sphere. PyVista (VTK) keeps the scene on the GPU and turns it in 0.6 ms per frame against dataviz's 2–5 ms (still 200–500 frames per second), but needs 80–100 ms to save an image and about 280 MB of memory.

Where it is not first: for a tiny live chart (1 000 points) on a single thread plotters is 0.1–0.2 ms faster per frame; dataviz on all cores is the fastest there. The GPU backend needs the least CPU time but ~240 MB of driver memory and ~0.3 s to start, so the default stays on the CPU.

Beyond Rust plotting libraries

Each of these was measured on the same machine, against the most common tool for the job:

Task dataviz Compared with
Density image of 100 M points (Datashader style), Rust / Python 70 ms / 81 ms Datashader 372 ms
Density image of 10 M points, Python 39 ms Datashader 73 ms
4-panel script through dataviz.pyplot (lines, scatter, log histogram, bars) 3.3 ms matplotlib 94 ms
1 M point line through dataviz.pyplot 17 ms matplotlib 190 ms
10 M rows from Polars / pyarrow into a chart 59 ms 508 ms / 2.86 s via NumPy
1 M point chart built in JavaScript (npm, Float64Array) 3 ms 214 ms in 0.18 (JSON)
1 M point chart built in C/C++ with binary arrays 4–7 ms 166 ms through JSON text
3D point cloud, 1 M colormapped points, CPU 73 ms 3.3 s in 0.18
Idle chart window, CPU use 0.5 % 7 % in 0.18

The pyplot rows are the median of warm runs in one process, with the imports excluded and both libraries saving the same PNG (script). The first call costs more: 7 ms against matplotlib's 326 ms, and the imports take about 60 ms against 230 ms. matplotlib does far more than these scripts use, so these numbers compare the common case, not the whole library.

Gallery

Every image links to its example in dataviz-examples (code, cargo run, output).

Live, interactive and animated

Zoom, pan and range slider
Zoom, pan and range slider
Live dashboard (streaming data)
Live dashboard (streaming data)
Animations (GIF, APNG, WebP, MP4)
Animations (GIF, APNG, WebP, MP4)
Live Binance BTC dashboard
Live Binance BTC dashboard
Interactive HTML (hover, crosshair)
Interactive HTML (hover, crosshair)
In the browser (WebAssembly)
In the browser (WebAssembly)
Inside an egui app
Inside an egui app
CPU, multi-core and GPU backends
CPU, multi-core and GPU backends
Charts in the terminal
Charts in the terminal
From C and C++ (CMake)
From C and C++ (CMake)
Grammar of graphics (data + mark + encodings)
Grammar of graphics (data + mark + encodings)
Grammar of graphics: facets
Grammar of graphics: facets

For data scientists, biologists, engineers and traders

Data science: ROC, confusion matrix, regression
Data science: ROC, confusion matrix, regression
Models: SHAP, calibration, learning curve, UpSet
Models: SHAP, calibration, learning curve, UpSet
Biology: DNA logo, GWAS, volcano, UMAP, survival
Biology: DNA logo, GWAS, volcano, UMAP, survival
Clustermap of gene expression
Clustermap of gene expression
Genomics: Circos, Hi-C, trees, oncoprint
Genomics: Circos, Hi-C, trees, oncoprint
3D DNA and cell turning around x, y, z
3D DNA and cell turning around x, y, z
3D: DNA, PDB molecules, cell, organoid, UMAP
3D: DNA, PDB molecules, cell, organoid, UMAP
Protein cartoons, Ramachandran, isosurfaces
Protein cartoons, Ramachandran, isosurfaces
Engineering: spectrum, spectrogram, Nyquist, Smith
Engineering: spectrum, spectrogram, Nyquist, Smith
Bode plot
Bode plot
Streamlines, ternary, SPC, Pareto, 3D waterfall
Streamlines, ternary, SPC, Pareto, 3D waterfall
Trading: Ichimoku, VWAP, volume profile, depth
Trading: Ichimoku, VWAP, volume profile, depth
Order flow: liquidity, footprint, TPO, options
Order flow: liquidity, footprint, TPO, options
Drawing tools: trend lines, levels, Fibonacci
Drawing tools: trend lines, levels, Fibonacci
NIfTI and DICOM scans, lit volume rendering
NIfTI and DICOM scans, lit volume rendering
Business: bullet, slope, chord, streamgraph
Business: bullet, slope, chord, streamgraph

Lines, points and bars

Line styles
Line styles
Markers, steps and smoothing
Markers, steps and smoothing
Area and fill between
Area and fill between
Stacked areas
Stacked areas
Scatter and bubble charts
Scatter and bubble charts
Bar charts
Bar charts
Stem and waterfall charts
Stem and waterfall charts
Error bars and confidence bands
Error bars and confidence bands
Vector field and function plots
Vector field and function plots

Statistics

Histograms, KDE and ECDF
Histograms, KDE and ECDF
Box and violin plots
Box and violin plots
Strip, swarm, ridgeline, Q-Q
Strip, swarm, ridgeline, Q-Q
Facets (small multiples)
Facets (small multiples)
Pair plot (scatter matrix)
Pair plot (scatter matrix)
2D histogram and hexbin
2D histogram and hexbin

Finance and time

Candlestick chart
Candlestick chart
Bollinger, RSI, MACD
Bollinger, RSI, MACD
Heikin-Ashi candles
Heikin-Ashi candles
Time series
Time series
Gantt chart
Gantt chart
Parallel coordinates and calendar
Parallel coordinates and calendar

Grids, fields and 3D

Heatmap (correlation matrix)
Heatmap (correlation matrix)
Contour plots
Contour plots
Images
Images
3D surface, Lorenz attractor, mesh
3D surface, Lorenz attractor, mesh
Volume rendering, maximum intensity
Volume rendering, maximum intensity

Maps

Choropleth and flight routes
Choropleth and flight routes
States, flows, hexbin, OpenStreetMap basemap
States, flows, hexbin, OpenStreetMap basemap
Map projections (incl. equal-area)
Map projections (incl. equal-area)
Conic (USA, Europe) and polar maps
Conic (USA, Europe) and polar maps
Globe with a great-circle route
Globe with a great-circle route
Spinning globe
Spinning globe

Parts, flows and polar

Pie and donut charts
Pie and donut charts
Treemap and sunburst
Treemap and sunburst
Funnel and gauge
Funnel and gauge
Sankey diagram
Sankey diagram
Network graph
Network graph
Arc diagram, edge bundling
Arc diagram, edge bundling
Polar and radar charts
Polar and radar charts

Axes, layout, text and style

Subplots with shared axes
Subplots with shared axes
Logarithmic scales
Logarithmic scales
Broken axes
Broken axes
Tick formats
Tick formats
Annotations
Annotations
Math notation (TeX)
Math notation (TeX)
Any language and emoji
Any language and emoji
Color vision simulation
Color vision simulation
Theme: light
Theme: light
Theme: dark
Theme: dark
Theme: ggplot
Theme: ggplot
Theme: seaborn
Theme: seaborn
Theme: minimal
Theme: minimal
Theme: publication
Theme: publication
Theme: solarized
Theme: solarized
Theme: high contrast
Theme: high contrast

JavaScript

The same renderer in WebAssembly (wasm/npm, npm package dataviz-rs): charts from a JSON spec in the browser, Node, Deno and Bun; SVG, PNG, HTML or a live, interactive canvas.

import { init, Chart } from "dataviz-rs";
await init();
new Chart({ type: "line", x: [0, 1, 2], y: [1, 3, 2] }).mount(canvas);

C and C++

A C library with a header-only C++17 wrapper (capi/) for Linux, macOS and Windows, plus static libraries for iOS and Android. It covers every chart type and all outputs, raw pixels for your own UI, interactive windows and live data. Large arrays are passed as pointers, never as JSON text. With CMake:

add_subdirectory(dataviz/capi dataviz)
target_link_libraries(app PRIVATE dataviz::dataviz)
#include "dataviz.hpp"
dataviz::Figure fig(900, 500);
fig.axes().line(t, v, dataviz::Style().label("signal"));
fig.save("signal.png");

Python

The same renderer for Python (python/): NumPy, pandas and Polars data, Jupyter display, 5–22× faster than matplotlib. Wheels for Linux, macOS and Windows (Python 3.9+) are on PyPI:

pip install dataviz-rs        # imported as `dataviz`
import numpy as np, dataviz as dv
x = np.linspace(0, 10, 100_000)
fig = dv.Figure(900, 500, title="Signal")
fig.axes().line(x, np.sin(x), label="sin").set(x_label="t [s]")
fig.save("signal.png")

Differences from matplotlib

dataviz.pyplot covers the common calls of matplotlib's pyplot and Axes API (listed in the Python README), not all of matplotlib. Keep using matplotlib when you need:

  • Calls that are missing: annotate, errorbar, contour, step, stackplot, hexbin, colorbar, twinx, set_xticks, tick_params, and the artist, patch and transform APIs. (dv.Figure has contours, through chart("contour", …), and colorbars, through colorbar= on heatmaps and colored scatters, but under its own names.)
  • Fine control: rcParams, tick locators and formatters, custom projections, GridSpec and sharex/sharey in subplots.
  • Every argument honored: unknown keyword arguments are ignored, not rejected, so a script keeps running but may look different (for example hist(bins=[…edges…]), bar(width=…) or savefig(dpi=…)). The docstrings say what each call supports.
  • Embedding in Qt, Tk or GTK applications through matplotlib's backends, and the many libraries built on matplotlib (seaborn, pandas .plot()).

Use it from Claude

The Claude Code plugin gives Claude all of these charts: it draws from your data, CSV/JSON files and PDB structures, looks at the image and refines it.

/plugin marketplace add dataviz-rs/dataviz
/plugin install dataviz@dataviz

Then ask: "plot bench.csv and compare the branches", "show 1UBQ as a cartoon with its Ramachandran plot", or use /dataviz:plot and /dataviz:molecule. Other MCP clients use the server directly: cargo install dataviz-mcp (dataviz-mcp).

Installation

[dependencies]
dataviz = "1"
# dataviz = { version = "1", features = ["pdf", "gpu"] }
# dataviz = { version = "1", default-features = false }   # headless / wasm32
Feature Default What it adds
window yes interactive windows (minifb)
pdf no PDF output
gpu no GPU rasterization (wgpu)

Requires Rust 1.89 or newer. On Linux the window feature needs the usual windowing libraries (libxkbcommon-dev, libwayland-dev).

Stability

dataviz follows semantic versioning from 1.0 on: code written for 1.0 keeps compiling and working with every 1.x release.

  • Covered:
    • the public Rust API, with its cargo features (they are kept);
    • the JSON spec format (fields keep their meaning; new fields and chart types are added);
    • the C API in dataviz.h (functions keep their signatures; new ones are added).
  • New things come in minor versions (1.1, 1.2, …). Enums that grow (chart kinds, projections, colormaps, markers, …) are #[non_exhaustive], so a match on them needs a _ arm.
  • Fixes come in patch versions.
  • Not covered:
    • the exact pixels of a rendering (anti-aliasing, layout and tick choices can improve);
    • items marked #[doc(hidden)];
    • performance characteristics.
  • Minimum Rust version: raised only in minor versions, and noted in the changelog.

The Python (dataviz-rs on PyPI) and npm (dataviz-rs) packages have their own versions.

Changelog

See CHANGELOG.md.

License

MIT; see LICENSE. The embedded DejaVu Sans font has its own license (assets/DejaVuSans-LICENSE.txt); the world map is Natural Earth (public domain).

How it's made

dataviz is developed with heavy AI assistance (Claude Code). The author decides the design and the scope, reviews the changes and runs the tests, fuzzing and benchmarks; the benchmark code is public so the numbers can be checked. How an early benchmark got it wrong, and how it was fixed: My benchmark said 40× faster than matplotlib. It was wrong. Bug reports about anything that looks wrong are very welcome.

Contributing

Bug reports, ideas and pull requests are welcome at https://github.com/dataviz-rs/dataviz. Issues labelled good first issue are a good place to start.

If dataviz saves you time, a ⭐ on GitHub helps others find it.

Explore related projects

Loading…