【发布时间】:2020-12-09 20:30:02
【问题描述】:
我对 C 有点陌生,我想使用 gnuplot 在 C 中绘制数据。现在我有这个代码:
FILE *gnuplot = popen("gnuplot", "w");
fprintf(gnuplot, "plot '-' lc 6 w lp\n");
for (int i = 0; i < size; i++){
fprintf(gnuplot, "%g %g \n", x[i], y[i] );
}
fprintf(gnuplot, "e\n");
fflush(gnuplot);
它一次打印一个图并且工作得很好,但是我需要在相同的坐标中同时绘制 两个图。有没有办法在我的程序中包含一些代码行,或者我应该使用完全不同的方法?
【问题讨论】: