2

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.

lucacerone
  • 9,859
  • 13
  • 52
  • 80
  • If you can use GNUplot, then it can be done this way: http://stackoverflow.com/questions/4445720/how-to-plot-graphs-in-gnuplot-in-real-time-in-c. Also here is a library for that: http://www.suiri.tsukuba.ac.jp/~asanuma/gnuplot++/. The second link infact provides some handy examples as well. – maths-help-seeker Oct 02 '12 at 22:50

1 Answers1

2

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.

maths-help-seeker
  • 946
  • 1
  • 10
  • 30