現在我可以在批量打印這樣如何在gnuplot中設置awk變量?
filename(n) = sprintf("x0%.3fgammamax.txt", n)
set term png size 800,600 enhanced
do for [ii=0:10]{
tempi=(ii+0.0)
outfile = sprintf('x0%.3fgammamax-pm3d.png',tempi)
set output outfile
splot filename(tempi) notitle with pm3d
}
不過,現在我需要處理的數據之前,我繪製用awk。命名addblanks.awk文件的內容是
/^[[:blank:]]*#/ {next} # ignore comments (lines starting with #)
NF < 3 {next} # ignore lines which don't have at least 3 columns
$1 != prev {printf "\n"; prev=$1} # print blank line
{print} # print the line
如果我不需要動態文件名,我用命令:
splot "<awk -f addblanks.awk data.txt" notitle with pm3d
不過,我需要動態文件名仍使用現在的awk 。結果應該是這樣的:
splot "<awk -f addblanks.awk filename(tempi)" notitle with pm3d
如何讓它工作?
工作就像魅力! – user3471272