0

How can I ask the user to enter a value during the execution of a GnuPlot script?

I would like to use stdin to initialize some plotting parameters.

I have try to call : a=system("read") and pause mouse keypressed

Without sucess.

Any help welcomed. Thanks

1 Answers1

0

I assume you are on Linux. Your shell command must write something to stdout which gnuplot can read from stdin. Something like this should work:

print "Pleaser enter a number: " 
a = system("read a; echo $a")

plot a*sin(x)
pause mouse close

Would it be an alternative to write a script in bash, python, ... which reads user input and calls gnuplot afterwards? (The links are my first google results, I have mainly read the title.)

maij
  • 4,094
  • 2
  • 12
  • 28