matplotlib-cpp icon indicating copy to clipboard operation
matplotlib-cpp copied to clipboard

No function "savefig" under namespace matplotlibcpp

Open ZiqiFrancisFan opened this issue 4 years ago • 1 comments

I just tried to build code with the minimal example, and the compiler complained that "matplotlibcpp::savefig" is not declared. I checked the head file "matplotlibcpp.h" and indeed, I found no wrapper definition for "savefig". Is it a bug or did I miss something?

ZiqiFrancisFan avatar Jun 21 '21 11:06 ZiqiFrancisFan

Hey, did you resolve this issue somehow?

BTW, I'm using ubuntu 20.04, GCC, Python3.8.

I manage to compile the code by changing savefig to save. Now I get a segmentation fault. It seems like the error occurs in the file matplotlibcpp.h in line 288, when calling Py_Finalize().

Edit:

I think this is a duplicate of #248. with the same solution of adding Py_Finalize();

Thanks.

TheHolyJoker avatar Jul 28 '21 14:07 TheHolyJoker