I am trying to pass a string as System Argument variable to gnuplot from python. I have done this several times before, but surprisingly it does not work this time. I used this Topic How to pass command line argument to gnuplot?, but I did not work
import subprocess
ii=2
while ii<5:
if (ii==2):
name='rectangular'
a="gnuplot -e 'name="+name+ "' graph3.gp"
if (ii==3):
name='trapezoidal'
if (ii==4):
name='simpson'
a="gnuplot -e 'name="+str(simpson)+ "' graph3.gp"
subprocess.call(a, shell='true')
ii=ii+1
I always get the same error message:
line 0: undefined variable: rectangular
line 0: undefined variable: trapezoidal
line 0: undefined variable: simpson