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
I've adapted the accepted answer to plot a float array while avoiding the use of a temporary file. In it, float* data_ is the array and size_t size_ its size. Hopefully it is helpful for someone!
Cheers,
Andres
void plot(const char* name="FloatSignal"){
// open persistent gnuplot window
FILE* gnuplot_pipe = popen ("gnuplot -persistent", "w");
// basic settings
fprintf(gnuplot_pipe, "set title '%s'\n", name);
// fill it with data
fprintf(gnuplot_pipe, "plot '-'\n");
for(size_t i=0; i