私は Python の初心者です。名前に変数が含まれる Gnuplot.py で作成された画像 (大量の画像) を取得するにはどうすればよいですか? 単一の画像を作成するこの関数があります:
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)
そして、この関数は for ループで使用されます:
i = 0
for row in data:
config_soubor.write(str(i) + " " + row[22:])
printimage("config_soubor.conf", i)
i = i + 1
「未定義の変数: ファイル名」というエラーをまだ取り除くことができません。
ありがとう、マイズリク