在我的bash文件中,我有这个声明:
gnuplot -e "filename='Traffic1'" MyplotFile
现在我想通过Traffic1或更好的方式将filename的值称为我的gnuplot输出文件的名称,该文件是png格式.
我在MyplotFile上有这些行:
set output 'filename.png'
但输出是filename.png!我希望将Traffic1.png作为输出.如何正确定义此行:
set output 'filename.png'
PS如果您需要了解-e,请转到此链接
随着'filename.png'你简单地定义一个字符串.gnuplot应该怎么知道,你的意思是变量?
您可以将变量与扩展字符串连接起来
set output filename . '.png'
或者您可以使用sprintf:
set output sprintf('%s.png', filename)
| 归档时间: | 
 | 
| 查看次数: | 3113 次 | 
| 最近记录: |