Search code examples
c++ploteps

Create EPS from vectors, C++


I have some C++ code that creates two vectors of double x,y as the results of my simulations.

At the moment I save x and y into a .txt file and import these values into Matlab for plotting and saving the figure as eps.

How can I generate and save my plots directly from C++?

I don't want to interface Matlab and C++ for this, but rather using C++ libraries.


Solution

  • You can use GNUplot for this purpose of plotting your data. There is a handy library here: http://www.suiri.tsukuba.ac.jp/~asanuma/gnuplot++/ which can give you API's that can be called from your program to plot your data using GNUplot.