I am trying to use gnuplot
directly from my C application under MacOSX in combination with Xcode. I downloaded the appropriate source files gnuplot_i.h
and gnuplot_i.c
(from here, version gnuplot_i-2.11
) and included the header file. This all compiles just fine. I also checked if I had the newest version installed, which I appear to have:
[mycomputer:projectfolder]Me $ brew upgrade gnuplot
Error: gnuplot 5.0.3 already installed
In my application I just tried to use a simple example from the Documentation page (this one). The output is simply
sh: gnuplot: command not found
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);
Does anyone have an idea, what could be the cause of the problem? I never used gnuplot before but I would love to. Right now I always need to write to a file and plot using MATLAB...
I already read some posts here and this one might have a solution, but I am not sure how to replace the path in gnuplot_cmd()
or if that's possible in the first place.
Does it have something to do with the fact that I am not on a Linux machine?
Thanks in advance :)
edit gnuplot is installed here:
[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)