g++ minimal.cpp -std=c++11 -I/usr/include/python2.7 -lpython2.7 Result: A more comprehensive example: #include "matplotlibcpp.h" #include <cmath> namespace plt = matplotlibcpp; int main() { // Prepare data. int n = 5000; std::vector<double> x(n), y(n), z(n), w(n,2); ...
matplotlib-cpp。基于C++调用Python的方法将matplotlib封装了一层。但比用OpenCV的imshow写的图表绘制好。 matplotlib-cpp项目地址在:https://github.com/lava/matplotlib-cpp,仓库内容简单,核心的东西就是一个头文件matplotlibcpp.h, 这个头文件封装了大量了的C++调用mat