Of course you can do it. An example of a terminal command that displays two points connected by a line:
echo "plot \"< echo -e '4 5\n 3 2'\" w lp pt 2" | gnuplot
If you want to have a postscript, you can add the following:
echo "set terminal postscript; plot \"< echo -e '4 5\n 3 2'\" w lp pt 2" | gnuplot &> out.ps
If you are now using system () or popen () (to catch the output stream), the rest should be simple.
Edit: It seems there are some C (++) - Gnuplot interfaces. Check out this website , which gives an excellent overview of C, C ++, Python, and Fortran wrappers. I'm not sure that they are relevant and work with the latest versions of Gnuplot, but if you do not adapt, it should not be so difficult.
source share