安装:
- 官网:
这是个软件,但是打开之后,就是个命令行,类似于Matlab:
gnuplot
在C++调用:
-
首先把
gnuplot.exe的目录gnuplot.exe
的目录添加到Path
环境变量:
-
在C++中调用的Demo:
#include <iostream>
using namespace std;
int main()
{
char*gnuplotPath = "gnuplot.exe";
FILE* gp = _popen(gnuplotPath,"w");
if (gp == NULL)
{
cout<<("Cannotopen gnuplot!\n")<<endl;;
return 0;
//exit(0);
}
fprintf(gp,"plot sin(x)\n");
fprintf(gp,"pause mouse\n");//用户点击后退出
_pclose(gp);
}
-
效果图:
效果图