I have written a python script where I have taken mu = input('Enter some number')
. Now I have used subprocess module to write a gnuplot script inside the python script. My gnuplot code is:
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`
But in this case to run the program I have to define mu
inside this gnuplot script. I don't want to do like this. I want to pass mu
from python input to gnuplot, I don't want to define mu
again inside gnuplot. Because after doing that I have to change the value of mu
every time as I take input of mu
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.