Example (or code snippet) for Matplotlib from a C++ application?

Thanks a lot! But, must I build it in some special way? For a quick check, I just changed the test function to be main() and compiled it reusing a standard CMakeLists.txt from other examples, then invoked it with the DejaVuSans.ttf font as argument, and the FreeType text did print, but the math was not parsed from LaTeX… must I add any special setting at either compile time (or at the link line)?

BTW, I do have vtkpython on the $PATH (just in case this code needs to invoke vtkpython, which I don’t know).

(EDIT: I added vtkRenderingMatplotlib in the find_package(VTK COMPONENTS … ) part of the CMakeLists.txt, but it doesn’t change the result --and yes, “libvtkRenderingMatplotlib-8.90.a” can be seen in the link line)

Look at the result: