使用GNUPLOT从C程序绘制图形

时间:2015-02-09 14:11:05

标签: c graph statistics

我写了一个计算机模拟程序(细节是不相关的),它写了两个文件,一些结果是2 colums格式,然后我使用另一个终端的gnuplot成功地在图表上绘制这些结果。 现在我想将图表与程序集成,以便我不必从另一个终端运行gnuplot。 所以

/*while loop that writes data on the 2 files, the data is consistent as the graphs are good running gnuplot from a separate terminal
*/

fclose(file_wait);
fclose(file_discarted);

system("gnuplot -p -e \"plot 'wait.dat'\"");
system("gnuplot -p -e \"plot 'discarted.dat'\"");

有趣的是,当文件少于1000行(完整数据集为2600行)时,该程序可以正常工作,并且程序终止但是grapsh没有可视化。

0 个答案:

没有答案