Hi All
I am trying to plot on freefem by using gnuplot. I tried this example Visualization. But the plot did not come from Gnuplot . I want to get this .Can anyone help?
Hi Alice,
Are you using a linux/UNIX system? The example works for me under ubuntu.
The part of the script that calls gnuplot is
// Calls the gnuplot command, waits 5 seconds and generates a postscript plot (UNIX ONLY)
exec("echo 'plot \"plot.gp\" w l \n pause 5 \n set term postscript \n set output \"gnuplot.eps\" \n replot \n quit' | gnuplot");
Hi Vincent,
My computer is Windows, but I loaded gnuplot.
Hi,
It is simple. Use ofstream command in freefem code and download gnuplot then it is very much straightforward.
I looked again into this problem, to have the script work under Windows11 similar to ubuntu/linux.
I replaced the last line by:
exec("C:\\Progra~1\\gnuplot\\bin\\gnuplot.exe gnuplot.plt");
This is because gnuplot is installed under C:\Program Files\gnuplot\bin\ by the installer. Paths with a space character seem to not work well with Powershell (v1) when I execute FreeFem++ under Windows11, so it is here replaced with the 8-character old-Windows syntax.
I also created the file gnuplot.plt to avoid trouble with the echo command:
plot "plot.gp" w l
pause 5
set term postscript
set output "gnuplot.eps"
replot
quit
Now it seems to work OK for me.
Hope this helps,
Vincent