1

希望你能帮助我解决这个问题。

我一直在linux下使用gnu plot没有问题,但是atm我正在为windows开发一个项目。

我已经为 windows 安装了 gnuplot 4.6 并将 gnuplot/bin 添加到我的系统路径中。我的代码编译并运行,但 gnuplot 没有显示任何图表。

我的代码看起来像这样:

FILE *pipe = _popen("pgnuplot -persist","w");
fprintf(pipe, "set title \"%s\"\n",plotname); 
fprintf(pipe,"plot '-' with lines\n");

for(i = 0; i < alot ;i++)
{
    fprintf(pipe, "%d %d \n", i, data[i]); 
}

fprintf(pipe, "e");
fflush(pipe);
fclose(pipe);

我试过使用'-noend'命令,将终端设置为windows并使用wgnuplot.exe等,但到目前为止还没有运气。

任何帮助将不胜感激。

亲切的问候

4

0 回答 0