Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c++ application using qt, how to include gnuplot

Tags:

c++

qt

gnuplot

Im looking for a solution or some guidelines on how to, from a c++ application using Qt, create scientific plots. I have set my mind on gnuplot because it have nice features for later use of my plots in latex and such.

My question is then, can i and how do i accomplish to show a plot in qt and also makes it possible to expose the gnuplot commands for generating the plot later for reporting.

Should i based on my data create some datafile, and create a text file with the commands?

Can it be integrated into my c++ application such that i create the plot, see it in my application and then save the data and plot file.

Any input would be nice. I dont now gnuplot at the moment, and wonder if its a application on unix or its a library i can use in my application. Thanks.

like image 715
Poul K. Sørensen Avatar asked Feb 18 '12 03:02

Poul K. Sørensen


1 Answers

Easiest way is to have your app run gnuplot in a system() or similar call, plotting to an image and then display the image.

If you want more detailed control there is an iostream lib to talk to gnuplot or an old C interface

like image 169
Martin Beckett Avatar answered Oct 02 '22 11:10

Martin Beckett