0

I have gnuplot on Windows. I want to write the script on windows shell to authomatically plot in gnuplot, namely something like

   "...\gnuplot.exe" 'plot "file:exe" using 1:2'

But when trying to run such script, an error occurs: it writes "'plot", line 0: Cannot open script file 'plot'".

I tried to create temporary script a.cmd, in which the command

   plot "file:exe" using 1:2

is present. Now my command to run gnuplot looks like

   "...\gnuplot.exe" "a.cmd"

But then nothing happened, gnuplot isn't running with no errors.

I know that to load script in gnuplot window I need to run

   load "a.cmd" ,

and all will work. But when I try to launch

  ".../gnuplot.exe" 'load "a.cmd"' ,

then again error "Cannot open script file 'load'" occurs.

Next, I try to put a.cmd to gnuplot folder, and then run

 ".../gnuplot.exe" a.cmd

Now it launches without errors, but the gnuplot screen appears on the second and vanishes.

So how to run gnuplot plot through cmd script (launching the script -> launching gnuplot with plotting)?

2
  • Windows is really useless with single quotes. I have never tried it, but I suspect if you put all your gnuplot commands in a file called plot.cmd and run gnuplot < plot.cmd it will probably work. May 27, 2016 at 10:16
  • stackoverflow.com/q/12328603/2604213
    – Christoph
    May 27, 2016 at 14:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.