I'm a newbie in Python and I would like to ask you, how can I get images (a lot of images) made by Gnuplot.py with variable in name? I have this function, which creates single image:
def printimage(conf, i):
filename = str(i) + "out.postscript"
g = Gnuplot.Gnuplot()
g.title('My Systems Plot')
g.xlabel('Date')
g.ylabel('Value')
g('set term postscript')
g('set out filename')
databuff = Gnuplot.File(conf, using='1:2',with_='line', title="test")
g.plot(databuff)
And this function is used in for loop:
i = 0
for row in data:
config_soubor.write(str(i) + " " + row[22:])
printimage("config_soubor.conf", i)
i = i + 1
I still can't get rid of error "undefined variable: filename".
Thanks, Majzlik