【发布时间】:2013-05-03 02:09:18
【问题描述】:
我是 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
我仍然无法摆脱错误“未定义的变量:文件名”。
谢谢, 马吉兹利克
【问题讨论】:
标签: python variables filenames gnuplot