Matplot++ is a C++ graphics library for plotting and visualizing data. It targets scientific and data-analysis workflows in modern C++ codebases.
Overview
Matplot++ helps programmers and scientists plot data and communicate results from C++ applications. It is aimed at scientific data visualization rather than general-purpose UI graphics, with syntax aligned to similar plotting libraries.
The library supports interactive plotting, export of figures in formats suited to publications, and many plot types including lines, contours, polar plots, vector fields, surfaces, graphs, and images. It offers multiple coding styles, such as member versus free-standing functions, reactive versus quiet figures, and method chaining.
Plotting can use pluggable backends, including an experimental OpenGL backend. Runtime plotting may depend on Gnuplot on the host system. Distribution options mentioned in the project include package managers such as vcpkg, Homebrew, and the Arch User Repository, plus CMake integration via subdirectory, installed package, FetchContent, or CPM.cmake.
Compared with other C++ options described in the project materials, alternatives are often non-dedicated libraries tied to existing user interfaces or bindings to other languages, while Matplot++ is presented as a dedicated visualization library with a broad set of plot categories.
Key features
- Interactive plotting in C++
- High-quality figure export
- Many specialized plot categories
- Compact syntax similar to other plot libraries
- Multiple coding styles
- Generic pluggable backends
- CMake and package-manager installs
- Annotations and multiplot layouts
Use cases
- Scientific data plots in C++
- Publication-ready figure export
- Contour and polar visualizations
- Exploring trends in measured data
- Embedding charts in CMake projects