Menu

How to call gnuplot like a subroutine from another language

Help
2017-03-30
2017-11-12
  • Brian Murphy

    Brian Murphy - 2017-03-30

    I am working on a Windows system.

    Can gnuplot be called directly from another program to output a graphics image file from a set of gnuplot commands? The way I am doing this now is to start an instance of wgnuplot.exe and "send" it commands which finish with an exit command, thereby closing the running instance of wgnuplot.exe . This means wnuplot briefly becomes another running program What I would rather do is call gnuplot directly, for example as a routine in a file like wgnuplot.DLL, and pass it a string argument containing the commands to be executed. There would be no need for an interactive command window or a plot window. All I want is to create a png graphics file.

    Is this possible?

     
  • Alain Reymond

    Alain Reymond - 2017-11-08

    You might have a look at the sourceforge Gnuplot/C project https://sourceforge.net/p/gnuplotc

    Also, you may pass gnuplot commands using popen in C.

     
  • Brian Murphy

    Brian Murphy - 2017-11-12

    Thanks for the reply, Alain. gnuplotc looks like a step in the right direction, but it seems to be limited to 2d plots. I am creating 3D plots. Can it do 3d plots?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.