我想定义一个 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
但我遇到了这个错误:
我尝试了ruakh的想法:行 0:需要常量表达式
gnuplot -e "filename = '${!fileName}'" plotFile
但我收到了这个警告:
"plotFile",第12行:警告:跳过没有有效数据点的数据文件
第12行?看看我脚本的最后一行。
我如何将变量传递给 gnuplot 的 -e 开关?
更新: 我的 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