title: How to pass a python variable into gnuplot script or how to take input in gnuplot?
body: <p>I have written a python script where I have taken <code>mu = input('Enter some number')</code>. Now I have used subprocess module to write a gnuplot script inside the python script. My gnuplot code is:</p>
  
  <pre><code>set zeroaxis
  set xrange[-5:5]
  set yrange[-5:5]
  f(x,y) = (mu*y+x-x**2+x*y)/y
  g(x,y) = sqrt(1+f(x,y)**2)
  plot "++" using ($1-.1/g($1,$2)):($2-.1*f($1,$2)/g($1,$2)):(.2/g($1,$2)):(.2*f($1,$2)/g($1,$2)) with vectors lw 1,'data.dat' u 1:2 w l
  pause -1`
  </code></pre>
  
  <p>But in this case to run the program I have to define <code>mu</code> inside this gnuplot script. I don't want to do like this. I want to pass <code>mu</code> from python input to gnuplot, I don't want to define <code>mu</code> again inside gnuplot. Because after doing that I have to change the value of <code>mu</code> every time as I take input of <code>mu</code> in python. Do anybody have a solution to this, how to pass variable inside gnuplot or how to take input in gnuplot like python? Thank you.</p>