This is a minimal header-only and dependency-free C++ plotting library.
It's maintained mostly for internal Signalsmith Audio use, so I'm adding features as I need them.
<animate>
(SMIL)All you need is the header file:
View the API docs for complete info.
Here's a minimal example, which sets up a 2D plot, adds some grid-lines/ticks:
See examples.cpp for code examples. Here are the images generated by that code:
You create a top-level object, which could be a Figure
or a Plot2D
:
When you create a sub-object (line, sub-plot, etc.), you are returned a reference. These elements are deliberately not copyable, so if you use auto
instead of auto &
it will complain.
Many methods return a reference to the object, allowing you to chain them together, e.g.:
There's an additional module in heatmap.h
for pixel-based heat-maps:
The colour map can be overridden by #define
ing SIGNALSMITH_HEATMAP_RGB
(before including heatmap.h
), which should be the name of a function which accepts (double v, uint8_t *rgb)
for v in 0-1.
There aren't any unit tests, just a visual check of the example plots.
Released as 0BSD. If you need anything else, get in touch. 🙂