我正在尝试直接使用MacOSX下的C应用程序中的gnuplot
和Xcode。我下载了相应的源文件gnuplot_i.h
和gnuplot_i.c
(来自here,版本gnuplot_i-2.11
)并包含了头文件。这一切都很好。我还检查了我是否安装了最新版本,我似乎有:
[mycomputer:projectfolder]Me $ brew upgrade gnuplot
Error: gnuplot 5.0.3 already installed
在我的应用程序中,我只是尝试使用“文档”页面(this one)中的一个简单示例。输出只是
sh:gnuplot:找不到命令
gnuplot_ctrl * g = gnuplot_init();
gnuplot_cmd(g, "set terminal png"); /* this outputs "sh: gnuplot: command not found" */
gnuplot_cmd(g, "set output \"/Users/Me/.../log/sine.png\"");
gnuplot_plot_equation(g, "sin(x)", "Sine wave");
gnuplot_close(g);
有没有人有想法,可能是问题的原因是什么?我之前从未使用过gnuplot,但我很乐意。现在我总是需要使用MATLAB写入文件和绘图...
我已在此处阅读了一些帖子,this one可能有解决方案,但我不确定如何替换gnuplot_cmd()
中的路径或者首先是否可以。
是否与我不在Linux机器上的事实有关?
提前致谢:)
编辑 gnuplot安装在此处:
[mycomputer:projectfolder]Me$ brew ls gnuplot
/usr/local/Cellar/gnuplot/5.0.3/bin/gnuplot
/usr/local/Cellar/gnuplot/5.0.3/libexec/gnuplot/5.0/gnuplot_x11
/usr/local/Cellar/gnuplot/5.0.3/share/gnuplot/ (36 files)
/usr/local/Cellar/gnuplot/5.0.3/share/man/ (2 files)