diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e92b7a1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,16 @@ +project(matplotlib_cpp) +cmake_minimum_required(VERSION 3.1) +set(CMAKE_CXX_STANDARD 14) +set(PYTHON_LIBRARY /usr/lib/x86_64-linux-gnu/libpython2.7.so) +set(PYTHON_INCLUDE_DIR /usr/include/python2.7) +find_package(PythonLibs 2.7 REQUIRED) + +include_directories(${PYTHON_INCLUDE_DIRS}) + +add_executable(modern modern.cpp matplotlibcpp.h) + +message(${PYTHON_LIBRARIES}) +target_link_libraries( +modern +${PYTHON_LIBRARIES} +) diff --git a/modern.cpp b/modern.cpp new file mode 100644 index 0000000..4080fd6 --- /dev/null +++ b/modern.cpp @@ -0,0 +1,26 @@ +#include +#include "matplotlibcpp.h" + +using namespace std; +namespace plt = matplotlibcpp; + +int main() +{ + // Prepare data. + int n = 5000; // number of data points + vector x(n),y(n); + for(int i=0; i