@jrss
I remember seeing a way to so that with python and octave, check the org babble documentation.
@jrss Actually I was referring to this. But I'm sure there is a way to do what you want with only elisp and gnuplot.
https://www.orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html#org4973b76