Didier Trosset Didier Trosset - 1 year ago 341
C Question

Anyone knows a matplotlib equivalent in C or C++

I've been using matplotlib in a Python project. It is great.

I have now to plot data in a C++ project. Is anyone aware of a plotting library in C or C++?

Note that I cannot accept GPL licensed libraries.

Raj Raj
Answer Source

You can try something like this:

#include "Python.h"

int main()
   PyRun_SimpleString("import pylab");
   return 0;

compile it with(I am using a Mac):

g++ -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/ plot.cpp -lpython2.6

Although you need to figure out how to make your data accessible to matplotlib (try writing it to a file and reading it back).

Hope that helps,


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download