How do I use gnuplot from C++?

Viewed 26129

I want to plot some graphs with (x,y) points which is generated from a C++ programme. I can successfully plot these data from gnuplot command from a terminal.

But I want to plot the same thing from a C++ programme, is this thing possible in ubuntu 16.04 lts ?

3 Answers

I am adding an answer since I cannot comment. As hackela said you can install gnuplot, then you can install gnuplot-iostream from aptitude instead of dowloading manually the header file, with this command:

sudo apt-get install libgnuplot-iostream-dev

Another option: C++ lib matplotplusplus is actually sending drawing commands to GnuPlot. It provides an API similar to python matplotlib. It is available in C++ package manager vcpkg.

Related