Publication-quality plotting. No Python, no runtime dependencies.
vplot ports matplotlib's rendering stack to C++23 and exposes it through a pure C header, so the same figure can be exported as PNG/SVG/PDF for a paper or drawn live into an ImGui panel inside a renderer. Because the rasterizer is matplotlib's own, the output is verified pixel-for-pixel against it.
The header-only C++ wrapper mirrors matplotlib's API closely enough that porting Python is nearly a transcription — keyword arguments become an options struct, and std::vector or {1, 2, 3} are accepted directly.
// #include "vpl/vpl.hpp" vplot::Figure fig; // fig = plt.figure() auto ax = fig.subplots(); // ax = fig.subplots() ax.plot(xs, ys, {.label = "sin"}); // ax.plot(xs, ys, label="sin") ax.plot(xs, ys2, "r--"); // ax.plot(xs, ys2, "r--") ax.legend(); // ax.legend() fig.savefig("figure.pdf"); // also .svg and .png
Every plotting command in matplotlib's headless API surface exists; about two thirds are complete against matplotlib's keyword arguments, and the rest are usable at their defaults. See the per-method coverage.
| Area | Commands |
|---|---|
| Lines & markers | plot, scatter, step, stem, stairs, errorbar, format strings |
| Bars & distributions | bar, barh, hist, boxplot, violinplot, pie, stackplot |
| Bands & regions | fill_between, fill_betweenx, fill, spans, reference lines |
| 2-D fields | imshow, matshow, pcolormesh, contour, contourf, hexbin, tripcolor |
| Vector fields | quiver, barbs, streamplot |
| Spectral | psd, csd, cohere, specgram, magnitude/phase/angle spectrum |
| Axes & layout | log scales, twin axes, colorbars, subplot grids, tight_layout |
| Output | RGBA buffer, PNG, SVG, PDF (text as glyph outlines) |
The desktop demo browser is compiled to WebAssembly and drawn through WebGPU or WebGL 2 — the same code that runs on Vulkan, Direct3D 12, and Metal on desktop, via VRI. WebGPU needs a recent Chrome/Edge; WebGL 2 runs everywhere.