C ++ - application using qt, how to enable gnuplot

Im looking for a solution or some recommendations on how to create scientific graphs using a C ++ application using Qt. I decided to use gnuplot because it has good opportunities for the subsequent use of my graphs in latex, etc.

My question is whether I can and how to do it to show the graph in qt, and also allows me to expose the gnuplot commands to generate the graph later for the message.

Should I create some data file based on my data and create a text file with commands?

Can it be integrated into my C ++ application to create a plot, see it in my application, and then save the data and the graph file.

Any input will be enjoyable. I'm not gnuplot right now and am wondering if his application can use unix or his library, which I can use in my application. Thanks.

+6
source share
2 answers

The easiest way is to start the gnuplot application in the system () or a similar call, apply the image to the image and then display the image.

If you need more granular control, there is an iostream lib to talk to gnuplot or the old C interface

+5
source

If your gnuplot is not installed in:

  • KD Chart, he uses the Qt ModelView programming model. It is a cross platform and even has a plugin that appears as a widget in Qt Designer.
  • The R-Project is great for building, it could be all you need as a standalone program, but also like the Qt R-Forge interface. This is also a cross platform.

Note: I have not tried R-Forge yet. R is actually a statistical programming language. A KD chart is for business type charts, but may have what you need.

0
source

Source: https://habr.com/ru/post/908756/


All Articles