python - Using gnuplot to generate a set of numbered images -


i'm newbie in python , ask you, how can images (a lot of images) made gnuplot.py variable in name? have function, 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 function used in loop:

i = 0 row in data:    config_soubor.write(str(i) + " " + row[22:])    printimage("config_soubor.conf", i)    = + 1 

i still can't rid of error "undefined variable: filename".

thanks, majzlik

right now, python script passing

set out filename 

to gnuplot. there 'filename' part of command string; variable filename set in script not being passed gnuplot. try replacing

g('set out filename') 

with

g('set out "'+filename+'"') 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -