【发布时间】:2014-08-12 07:39:05
【问题描述】:
我想定义一个 png 文件的 gnuplot 输出。如何在 gnuplot 上定义 fileName。
#This lines and also Traffic$j are define on my bash file.
# Traffic$j is the name of file and that is valid. Traffic$j is on the loop
# j is loop index
.
.
fileName=Traffic$j
.
.
我试试这个:
gnuplot -e "filename=${!fileName}" plotFile
但我犯了这个错误:
第 0 行:需要常量表达式
我尝试了ruakh的想法:
gnuplot -e "filename = '${!fileName}'" plotFile
但我听懂了这个警告:
“plotFile”,第 12 行:警告:跳过没有有效点的数据文件
第 12 行?看看我脚本的最后一行。
如何将变量传递给 -e 开启 gnuplot?
更新: 我的 plotFile 是这样的:
set terminal png size 720,450 enhanced font "H,11"
set output filename . '.png'
plot '../_numXY' using 2:3:(sprintf('%d', $1)) with labels offset 0,1 point pointtype 7 ps 2 lc rgb "green" notitle, \
filename using 1:2:($3-$1):($4-$2) with vectors linewidth 6 lc rgb "blue" notitle #line 12
【问题讨论】: