Header-only C++ SVG charts — heatmap, line, scatter — GR-style API + Solarized themes.
| OS / Compiler | GCC 13 | GCC 14 | Clang 18 | Clang 20 | Apple Clang | MSVC |
|---|---|---|---|---|---|---|
| Ubuntu 22.04 | ||||||
| Ubuntu 24.04 | ||||||
| macOS 15 | ||||||
| Windows |
Badge and documentation URLs resolve only once GitHub Pages is enabled for this (private) repository — the CI badge job publishes to the
gh-pagesbranch underbadges/(release) andbadges-staging/(staging).
#include <plot/all>
#include <vector>
int main() {
plot::theme(plot::solarized_dark); // process default; per-call: plot::use{t}
std::vector<double> x{1, 2, 3, 4, 5};
plot::line("throughput.svg", x,
{ {"scalar", {820, 1500, 2600, 3400, 3900}},
{"simd", {1900, 4100, 7200, 9800, 11500}} },
plot::title("throughput"), plot::xlabel{"n"}, plot::ylabel{"MB/s"});
}- GR-style API —
plot::line,plot::scatter, andplot::heatmap, each taking an output stream or filename plus order-independent named options (title,xlabel/ylabel,xlog/ylog,legend,width/height,margin). - Composable
view+grid— the no-osform (plot::line(x, y, …)) returns a deferred, movableviewrendered viaplot::save("f.svg", view)/plot::render(os, view);plot::grid(file|os, plot::rows{r}, plot::cols{c}, view…)tiles several views into one figure (auto layout ifrows/colsomitted). - Solarized themes —
plot::solarized_dark/plot::solarized_light; set the global default withplot::theme(t)or override per call withplot::use{t}. - Dependency-free C++23 — standard library only; no HDF5, zlib, boost, or third-party plotting/matrix/formatting libraries.
- CMake-friendly —
find_package(plot)exposes theplot::plottarget.
Set the process-global default with plot::theme(t), or override a single render
with plot::use{t}:
plot::theme(plot::tokyo_night); // process-global
plot::line("bw.svg", x, y, plot::use{plot::dracula}); // per-call overridePresets shipping in theme.hpp (added in a parallel lane): solarized_dark,
solarized_light, dark_plus, light_plus, monokai, dracula, nord,
one_dark, gruvbox_dark, gruvbox_light, tomorrow_night, night_owl,
material, tokyo_night.
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
ctest --test-dir build # plot_grplot is header-only — drop include/plot on your include path, or consume it via
CMake:
find_package(plot CONFIG REQUIRED)
target_link_libraries(my_app PRIVATE plot::plot)Each tagged release ships prebuilt packages (built by .github/workflows/package.yml):
| Platform | Artifact |
|---|---|
| Debian / Ubuntu | plot-dev_<ver>_all.deb |
| RedHat / Fedora | plot-devel-<ver>.noarch.rpm |
| Windows | plot-v<ver>-windows.exe (NSIS) |
| macOS | plot-v<ver>-darwin.pkg |
| any | plot-v<ver>-<os>.tar.gz / .zip |
The payload is a single amalgamated header plot.hpp (generated from
include/plot/ by scripts/amalgamate.py). Once installed — or just dropped in
your tree — it is all you need:
#include <plot.hpp> // no -I plot/, no other filesRegenerate it manually with python3 scripts/amalgamate.py include/plot plot.hpp.
-DPLOTS_BUILD_EXAMPLES=ON builds the demos under examples/; each writes an
.svg:
examples/line_chart→line_chart.svgexamples/scatter→scatter.svgexamples/heatmap→heatmap.svgexamples/dashboard→dashboard.svg(a 2×2view/gridfigure)
Every shipping driver, rendered with the Solarized theme. Each image follows your GitHub color scheme (light or dark) automatically.
Full API reference: vargalabs.github.io/plots
MIT — see LICENSE.