dataviz
Fast charts for Claude: 120+ chart types, CSV/JSON files and 3D molecules, drawn by dataviz (Rust) and returned as images.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
It has changed since its scan on 21 Nov 2026.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/dataviz-rs/dataviz with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/dataviz-rs/dataviz'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/dataviz-rs--dataviz)HTML
<a href="/listings/dataviz-rs--dataviz"><img src="/api/listings/dataviz-rs--dataviz/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
[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](https://github.com/dataviz-rs/dataviz-examples) — see the [gallery](#gallery).
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 14 lines
- {
- "name": "dataviz",
- "owner": { "name": "dataviz-rs", "url": "https://github.com/dataviz-rs" },
- "description": "Fast charts for Claude: 120+ chart types, CSV/JSON files and 3D molecules, drawn by dataviz (Rust) and returned as images.",
- "plugins": [
- {
- "name": "dataviz",
- "source": "./claude-plugin",
- "description": "Charts from data, files and PDB structures, returned as images Claude can look at and refine.",
- "category": "data",
- "tags": ["charts", "plotting", "visualization", "data-science", "bioinformatics", "finance", "mcp"]
- }
- ]
- }
README.md · README · 752 lines
- # **DataViz** 🚀
- <a href="https://crates.io/crates/dataviz">
- <img style="display: inline!important" src="https://img.shields.io/crates/v/dataviz.svg"></img>
- </a>
- <a href="https://docs.rs/dataviz">
- <img style="display: inline!important" src="https://docs.rs/dataviz/badge.svg"></img>
- </a>
- <a href="https://docs.rs/dataviz">
- <img style="display: inline!important" src="https://img.shields.io/crates/d/dataviz"></img>
- </a>
- <a href="https://pypi.org/project/dataviz-rs/">
- <img style="display: inline!important" src="https://img.shields.io/pypi/v/dataviz-rs.svg"></img>
- </a>
- <a href="https://www.npmjs.com/package/dataviz-rs">
- <img style="display: inline!important" src="https://img.shields.io/npm/v/dataviz-rs.svg"></img>
- </a>
- <a href="https://github.com/dataviz-rs/dataviz/stargazers">
- <img style="display: inline!important" src="https://img.shields.io/github/stars/dataviz-rs/dataviz?style=social"></img>
- </a>
- <a href="https://github.com/dataviz-rs/dataviz/actions/workflows/rust.yml">
- <img style="display: inline!important" src="https://github.com/dataviz-rs/dataviz/actions/workflows/rust.yml/badge.svg"></img>
- </a>
- **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](#performance)
- (with a much smaller API: see [differences](#differences-from-matplotlib)),
- and faster than the other Rust plotting libraries in nearly every
- measurement.**
- ```rust ignore
- 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
- ```
- ```python
- import dataviz.pyplot as plt # the common matplotlib calls, not all of them
- ```
- <table>
- <tr>
- <td width="33%"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-interactive/screenshots/interactive.gif" alt="Zoom, pan and range slider" width="100%"></td>
- <td width="33%"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-streaming/screenshots/streaming.gif" alt="Live dashboard" width="100%"></td>
- <td width="33%"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-animation/screenshots/animation.gif" alt="Animation" width="100%"></td>
- </tr>
- <tr>
- <td width="33%"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-maps/screenshots/maps.png" alt="Maps" width="100%"></td>
- <td width="33%"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-indicators/screenshots/indicators.png" alt="Finance" width="100%"></td>
- <td width="33%"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-math/screenshots/math.png" alt="Math notation" width="100%"></td>
- </tr>
- </table>
- **[Guide and chart catalog](https://dataviz-rs.github.io/dataviz/)** ·
- **[Live demo in the browser](https://dataviz-rs.github.io/dataviz/demo/)** ·
- [API docs](https://docs.rs/dataviz) · [Examples](https://github.com/dataviz-rs/dataviz-examples)
- *Built with heavy AI assistance (Claude Code); see [how it's made](#how-its-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](#performance)).
- 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
- ```toml
- [dependencies]
- dataviz = "1"
- ```
- ```rust no_run
- 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](https://github.com/dataviz-rs/dataviz-examples) — see
- the [gallery](#gallery).
- ## Your data, as it is
- Any iterable of numbers works — `Vec`, slices, ranges, iterators and arrays
- from other crates, without conversion or features:
- ```rust ignore
- ax.line(&x, &y); // Vec<f64>, &[f32], i64, …
- ax.line(&array1, &array1.mapv(f64::sin)); // ndarray
- ax.line(×, 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
- ```rust ignore
- 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](https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-egui),
- [WebAssembly](https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-wasm)).
- ### 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:
- ```rust ignore
- 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)?;
- ```
- ```json
- {"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
- ```rust ignore
- 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
- ```rust ignore
- 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
- <img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-biology-3d/screenshots/rotate.gif" alt="DNA and a cell turning around the z, x and y axes" width="100%">
- ```rust ignore
- 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
- ```rust ignore
- 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
- ```rust ignore
- let x = ax.trading_axis(×, "%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
- ```rust ignore
- 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
- ```rust ignore
- 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
- ```rust ignore
- 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
- ```rust ignore
- 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
- ```rust ignore
- 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
- ```rust ignore
- 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
- ```rust ignore
- 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](https://github.com/dataviz-rs/dataviz-examples/tree/main/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](https://github.com/dataviz-rs/dataviz-examples/blob/main/benchmarks/pyplot_bench.py)). 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](https://github.com/dataviz-rs/dataviz-examples) (code,
- `cargo run`, output).
- ### Live, interactive and animated
- <table>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-interactive"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-interactive/screenshots/interactive.gif" alt="Zoom, pan and range slider" width="100%"><br><sub>Zoom, pan and range slider</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-streaming"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-streaming/screenshots/streaming.gif" alt="Live dashboard (streaming data)" width="100%"><br><sub>Live dashboard (streaming data)</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-animation"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-animation/screenshots/animation.gif" alt="Animations (GIF, APNG, WebP, MP4)" width="100%"><br><sub>Animations (GIF, APNG, WebP, MP4)</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-binance"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-binance/screenshots/binance.png" alt="Live Binance BTC dashboard" width="100%"><br><sub>Live Binance BTC dashboard</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-html"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-html/screenshots/html.png" alt="Interactive HTML (hover, crosshair)" width="100%"><br><sub>Interactive HTML (hover, crosshair)</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-wasm"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-wasm/screenshots/wasm.png" alt="In the browser (WebAssembly)" width="100%"><br><sub>In the browser (WebAssembly)</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-egui"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-egui/screenshots/egui.png" alt="Inside an egui app" width="100%"><br><sub>Inside an egui app</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-backends"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-backends/screenshots/backends.png" alt="CPU, multi-core and GPU backends" width="100%"><br><sub>CPU, multi-core and GPU backends</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-terminal"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-terminal/screenshots/terminal.png" alt="Charts in the terminal" width="100%"><br><sub>Charts in the terminal</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-c-cpp"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-c-cpp/screenshots/dashboard.png" alt="From C and C++ (CMake)" width="100%"><br><sub>From C and C++ (CMake)</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-grammar"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-grammar/screenshots/grammar.png" alt="Grammar of graphics (data + mark + encodings)" width="100%"><br><sub>Grammar of graphics (data + mark + encodings)</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-grammar"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-grammar/screenshots/grammar_facets.png" alt="Grammar of graphics: facets" width="100%"><br><sub>Grammar of graphics: facets</sub></a></td></tr>
- </table>
- ### For data scientists, biologists, engineers and traders
- <table>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-data-science"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-data-science/screenshots/data_science.png" alt="Data science: ROC, confusion matrix, regression" width="100%"><br><sub>Data science: ROC, confusion matrix, regression</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-data-science"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-data-science/screenshots/evaluation.png" alt="Models: SHAP, calibration, learning curve, UpSet" width="100%"><br><sub>Models: SHAP, calibration, learning curve, UpSet</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-biology"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-biology/screenshots/biology.png" alt="Biology: DNA logo, GWAS, volcano, UMAP, survival" width="100%"><br><sub>Biology: DNA logo, GWAS, volcano, UMAP, survival</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-biology"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-biology/screenshots/clustermap.png" alt="Clustermap of gene expression" width="100%"><br><sub>Clustermap of gene expression</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-biology"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-biology/screenshots/genomics.png" alt="Genomics: Circos, Hi-C, trees, oncoprint" width="100%"><br><sub>Genomics: Circos, Hi-C, trees, oncoprint</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-biology-3d"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-biology-3d/screenshots/rotate.gif" alt="3D DNA and cell turning around x, y, z" width="100%"><br><sub>3D DNA and cell turning around x, y, z</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-biology-3d"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-biology-3d/screenshots/biology_3d.png" alt="3D: DNA, PDB molecules, cell, organoid, UMAP" width="100%"><br><sub>3D: DNA, PDB molecules, cell, organoid, UMAP</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-biology-3d"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-biology-3d/screenshots/protein.png" alt="Protein cartoons, Ramachandran, isosurfaces" width="100%"><br><sub>Protein cartoons, Ramachandran, isosurfaces</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-engineering"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-engineering/screenshots/engineering.png" alt="Engineering: spectrum, spectrogram, Nyquist, Smith" width="100%"><br><sub>Engineering: spectrum, spectrogram, Nyquist, Smith</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-engineering"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-engineering/screenshots/bode.png" alt="Bode plot" width="100%"><br><sub>Bode plot</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-engineering"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-engineering/screenshots/science.png" alt="Streamlines, ternary, SPC, Pareto, 3D waterfall" width="100%"><br><sub>Streamlines, ternary, SPC, Pareto, 3D waterfall</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-trading"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-trading/screenshots/trading.png" alt="Trading: Ichimoku, VWAP, volume profile, depth" width="100%"><br><sub>Trading: Ichimoku, VWAP, volume profile, depth</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-trading"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-trading/screenshots/orderflow.png" alt="Order flow: liquidity, footprint, TPO, options" width="100%"><br><sub>Order flow: liquidity, footprint, TPO, options</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-drawing-tools"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-drawing-tools/screenshots/drawing_tools.png" alt="Drawing tools: trend lines, levels, Fibonacci" width="100%"><br><sub>Drawing tools: trend lines, levels, Fibonacci</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-volume-files"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-volume-files/screenshots/volume_files.png" alt="NIfTI and DICOM scans, lit volume rendering" width="100%"><br><sub>NIfTI and DICOM scans, lit volume rendering</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-business"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-business/screenshots/business.png" alt="Business: bullet, slope, chord, streamgraph" width="100%"><br><sub>Business: bullet, slope, chord, streamgraph</sub></a></td></tr>
- </table>
- ### Lines, points and bars
- <table>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-line"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-line/screenshots/line.png" alt="Line styles" width="100%"><br><sub>Line styles</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-markers-steps-smooth"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-markers-steps-smooth/screenshots/markers_steps_smooth.png" alt="Markers, steps and smoothing" width="100%"><br><sub>Markers, steps and smoothing</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-area-fill"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-area-fill/screenshots/area_fill.png" alt="Area and fill between" width="100%"><br><sub>Area and fill between</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-stacked-area"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-stacked-area/screenshots/stacked_area.png" alt="Stacked areas" width="100%"><br><sub>Stacked areas</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-scatter-bubble"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-scatter-bubble/screenshots/scatter_bubble.png" alt="Scatter and bubble charts" width="100%"><br><sub>Scatter and bubble charts</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-bars"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-bars/screenshots/bars.png" alt="Bar charts" width="100%"><br><sub>Bar charts</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-stem-waterfall"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-stem-waterfall/screenshots/stem_waterfall.png" alt="Stem and waterfall charts" width="100%"><br><sub>Stem and waterfall charts</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-errorbars-band"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-errorbars-band/screenshots/errorbars_band.png" alt="Error bars and confidence bands" width="100%"><br><sub>Error bars and confidence bands</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-quiver-function"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-quiver-function/screenshots/quiver_function.png" alt="Vector field and function plots" width="100%"><br><sub>Vector field and function plots</sub></a></td></tr>
- </table>
- ### Statistics
- <table>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-histograms"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-histograms/screenshots/histograms.png" alt="Histograms, KDE and ECDF" width="100%"><br><sub>Histograms, KDE and ECDF</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-box-violin"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-box-violin/screenshots/box_violin.png" alt="Box and violin plots" width="100%"><br><sub>Box and violin plots</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-distributions"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-distributions/screenshots/distributions.png" alt="Strip, swarm, ridgeline, Q-Q" width="100%"><br><sub>Strip, swarm, ridgeline, Q-Q</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-facets"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-facets/screenshots/facets.png" alt="Facets (small multiples)" width="100%"><br><sub>Facets (small multiples)</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-facets"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-facets/screenshots/pair_plot.png" alt="Pair plot (scatter matrix)" width="100%"><br><sub>Pair plot (scatter matrix)</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-hist2d-hexbin"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-hist2d-hexbin/screenshots/hist2d_hexbin.png" alt="2D histogram and hexbin" width="100%"><br><sub>2D histogram and hexbin</sub></a></td></tr>
- </table>
- ### Finance and time
- <table>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-candlestick"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-candlestick/screenshots/candlestick.png" alt="Candlestick chart" width="100%"><br><sub>Candlestick chart</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-indicators"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-indicators/screenshots/indicators.png" alt="Bollinger, RSI, MACD" width="100%"><br><sub>Bollinger, RSI, MACD</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-indicators"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-indicators/screenshots/heikin_ashi.png" alt="Heikin-Ashi candles" width="100%"><br><sub>Heikin-Ashi candles</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-time-series"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-time-series/screenshots/time_series.png" alt="Time series" width="100%"><br><sub>Time series</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-gantt"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-gantt/screenshots/gantt.png" alt="Gantt chart" width="100%"><br><sub>Gantt chart</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-parallel-calendar"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-parallel-calendar/screenshots/parallel_calendar.png" alt="Parallel coordinates and calendar" width="100%"><br><sub>Parallel coordinates and calendar</sub></a></td></tr>
- </table>
- ### Grids, fields and 3D
- <table>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-heatmap"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-heatmap/screenshots/heatmap.png" alt="Heatmap (correlation matrix)" width="100%"><br><sub>Heatmap (correlation matrix)</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-contour"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-contour/screenshots/contour.png" alt="Contour plots" width="100%"><br><sub>Contour plots</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-image"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-image/screenshots/image.png" alt="Images" width="100%"><br><sub>Images</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-three-d"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-three-d/screenshots/three_d.png" alt="3D surface, Lorenz attractor, mesh" width="100%"><br><sub>3D surface, Lorenz attractor, mesh</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-three-d"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-three-d/screenshots/volume.png" alt="Volume rendering, maximum intensity" width="100%"><br><sub>Volume rendering, maximum intensity</sub></a></td></tr>
- </table>
- ### Maps
- <table>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-maps"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-maps/screenshots/maps.png" alt="Choropleth and flight routes" width="100%"><br><sub>Choropleth and flight routes</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-maps"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-maps/screenshots/regions.png" alt="States, flows, hexbin, OpenStreetMap basemap" width="100%"><br><sub>States, flows, hexbin, OpenStreetMap basemap</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-maps"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-maps/screenshots/projections.png" alt="Map projections (incl. equal-area)" width="100%"><br><sub>Map projections (incl. equal-area)</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-maps"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-maps/screenshots/conic_polar.png" alt="Conic (USA, Europe) and polar maps" width="100%"><br><sub>Conic (USA, Europe) and polar maps</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-maps"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-maps/screenshots/globe.png" alt="Globe with a great-circle route" width="100%"><br><sub>Globe with a great-circle route</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-maps"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-maps/screenshots/globe_spin.gif" alt="Spinning globe" width="100%"><br><sub>Spinning globe</sub></a></td></tr>
- </table>
- ### Parts, flows and polar
- <table>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-pie-donut"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-pie-donut/screenshots/pie_donut.png" alt="Pie and donut charts" width="100%"><br><sub>Pie and donut charts</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-treemap-sunburst"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-treemap-sunburst/screenshots/treemap_sunburst.png" alt="Treemap and sunburst" width="100%"><br><sub>Treemap and sunburst</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-funnel-gauge"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-funnel-gauge/screenshots/funnel_gauge.png" alt="Funnel and gauge" width="100%"><br><sub>Funnel and gauge</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-sankey"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-sankey/screenshots/sankey.png" alt="Sankey diagram" width="100%"><br><sub>Sankey diagram</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-network"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-network/screenshots/network.png" alt="Network graph" width="100%"><br><sub>Network graph</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-network"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-network/screenshots/dependencies.png" alt="Arc diagram, edge bundling" width="100%"><br><sub>Arc diagram, edge bundling</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-polar-radar"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-polar-radar/screenshots/polar_radar.png" alt="Polar and radar charts" width="100%"><br><sub>Polar and radar charts</sub></a></td></tr>
- </table>
- ### Axes, layout, text and style
- <table>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-subplots-shared"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-subplots-shared/screenshots/subplots_shared.png" alt="Subplots with shared axes" width="100%"><br><sub>Subplots with shared axes</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-log-scales"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-log-scales/screenshots/log_scales.png" alt="Logarithmic scales" width="100%"><br><sub>Logarithmic scales</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-broken-axis"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-broken-axis/screenshots/broken_axis.png" alt="Broken axes" width="100%"><br><sub>Broken axes</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-formats"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-formats/screenshots/formats.png" alt="Tick formats" width="100%"><br><sub>Tick formats</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-annotations"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-annotations/screenshots/annotations.png" alt="Annotations" width="100%"><br><sub>Annotations</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-math"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-math/screenshots/math.png" alt="Math notation (TeX)" width="100%"><br><sub>Math notation (TeX)</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-international"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-international/screenshots/international.png" alt="Any language and emoji" width="100%"><br><sub>Any language and emoji</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-accessibility"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-accessibility/screenshots/risky.png" alt="Color vision simulation" width="100%"><br><sub>Color vision simulation</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-themes"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-themes/screenshots/theme_light.png" alt="Theme: light" width="100%"><br><sub>Theme: light</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-themes"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-themes/screenshots/theme_dark.png" alt="Theme: dark" width="100%"><br><sub>Theme: dark</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-themes"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-themes/screenshots/theme_ggplot.png" alt="Theme: ggplot" width="100%"><br><sub>Theme: ggplot</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-themes"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-themes/screenshots/theme_seaborn.png" alt="Theme: seaborn" width="100%"><br><sub>Theme: seaborn</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-themes"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-themes/screenshots/theme_minimal.png" alt="Theme: minimal" width="100%"><br><sub>Theme: minimal</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-themes"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-themes/screenshots/theme_publication.png" alt="Theme: publication" width="100%"><br><sub>Theme: publication</sub></a></td><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-themes"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-themes/screenshots/theme_solarized.png" alt="Theme: solarized" width="100%"><br><sub>Theme: solarized</sub></a></td></tr>
- <tr><td width="33%" align="center"><a href="https://github.com/dataviz-rs/dataviz-examples/tree/main/plot-themes"><img src="https://raw.githubusercontent.com/dataviz-rs/dataviz-examples/main/plot-themes/screenshots/theme_high_contrast.png" alt="Theme: high contrast" width="100%"><br><sub>Theme: high contrast</sub></a></td></tr>
- </table>
- ## JavaScript
- The same renderer in WebAssembly ([`wasm/npm`](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.
- ```js
- 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/`](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:
- ```cmake
- add_subdirectory(dataviz/capi dataviz)
- target_link_libraries(app PRIVATE dataviz::dataviz)
- ```
- ```cpp
- #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/`](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](https://pypi.org/project/dataviz-rs/):
- ```sh
- pip install dataviz-rs # imported as `dataviz`
- ```
- ```python
- 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](python#matplotlib-code-unchanged)), 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](claude-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.
- ```text
- /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](mcp)).
- ## Installation
- ```toml
- [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](https://semver.org) 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](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. 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](https://github.com/dataviz-rs/dataviz/labels/good%20first%20issue)
- are a good place to start.
- If dataviz saves you time, a ⭐ on GitHub helps others find it.
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.