I have written a program which writes a list of data to a \'.dat\' file with the intention of then plotting it separately using gnuplot. Is there a way of making my code pl
Although I've seen a lot of ways of doing this, the most simplest way of doing this would be by using the system() (from stdlib.h) function in C.
First make a gnuplot script and save it as "name.gp" (neither the name nor the extension matter).
A simple script would be,
plot 'Output.dat' with lines
After saving this script file, just add
system("gnuplot -p name.gp");
at the end of your code.
It's as simple as that.
Make sure to add gnuplot path to the Windows System Path variables.