【发布时间】:2017-10-13 09:23:20
【问题描述】:
我正在尝试在 C 中使用 Gnuplot 进行绘图,到目前为止,我在另一个 thread 之后已经成功了一半,但找不到任何地方如何更进一步。
我的绘图代码如下:
char * commandsForGnuplot[] = {"set title \"Probability evolution\"", "plot 'data.temp' with linespoints", "set xlabel \"beta probability\"", "set ylabel \"Fraction of sick individuals\""};
FILE * temp = fopen("data.temp", "w");
FILE * gnuplotPipe = popen ("gnuplot -persistent", "w");
for (i=0; i < NB; i++){
fprintf(temp, "%lf \n", B[i]);
}
for (i=0; i < 4; i++){
fprintf(gnuplotPipe, "%s \n", commandsForGnuplot[i]);
}
除了 xlabel 和 ylabel 外,一切都显示正确,所以这部分肯定是错误的:
"set xlabel \"beta probability\"", "set ylabel \"Fraction of sick individuals\""
有人知道如何正确设置吗?
另外,如何设置这些标签的大小和标题?
谢谢一百万!
【问题讨论】: