I'm having an issue plotting on gnuplot
with my C program.
When I compile it, the popen()
function successfully opens up the gnuplot program, but once it's open, it does not receive the data from the fprintf
stream. Here is the relevant function from my program:
void plot_data() {
FILE* gnuplot = popen("wgnuplot.exe -persistent", "w");
fprintf(gnuplot, "plot '-'\n");
for(int j=0; j<DATA_ENTRIES; j++) fprintf(gnuplot, "%f %f %f\n", data[j].x, data[j].y, data[j].z);
fprintf(gnuplot, "e\n");
fflush(gnuplot);
}