【发布时间】:2013-07-25 21:13:15
【问题描述】:
我有一个简单的 gnuplot 脚本,可以绘制一堆图表。当我运行它时,它给出了以下错误:
编辑:根据建议,我已经大大减少了代码的长度
;
set xrange [pe_cnt:range_high];
set xtics xticks;
set xtics add (pe_cnt)
^
line 26: invalid expression
我花了很多时间试图解决这个问题。如果有人可以帮助我,我将不胜感激。这是我的代码:
range_high="`awk '{for(i=1;i<=NF;i++) if ($i=="--stop") print $(i+1)}' temp_info`"
xticks="`awk '{for(i=1;i<=NF;i++) if ($i=="--xticks") print $(i+1)}' temp_info`"
pe_cnt = "`awk '{for(i=1;i<=NF;i++) if ($i=="--pe_cnt") print $(i+1)}' temp_info`"
rd_cnt = "`awk '{for(i=1;i<=NF;i++) if ($i=="--rd_cnt") print $(i+1)}' temp_info`"
##################################################################################################
# Gnuplot script file for plotting Micron >= 1,16,32,64 WAFL single read last read
set autoscale
set grid
set title "Usable Flash Blocks vs PE cycles"
set xlabel "PE Cycles "
set ylabel "% Usable Flash Blocks "
set y2label "% WAFL Blocks"
if (pe_cnt == range_high) {
set xrange [pe_cnt-1:range_high]
set xtics xticks
set xtics add (pe_cnt-1) }
else {
set xrange [pe_cnt:range_high]
set xtics xticks
set xtics add (pe_cnt) }
set yrange [-10:140]
set y2range [-10:140]
set ytics 10
set y2tics 10
set term postscript color solid
set output 'Micron_srd.ps'
#set datafile separator ' '
set key top left
plot "Micron_all" using (($1+1)*pe_cnt):(((256-$31)*100)/256) smooth bezier title '(>= 1 Bad WAFL)' axis x1y1 with lines, \
"Micron_all" using (($1+1)*pe_cnt):(((256-$33)*100)/256) smooth bezier title '(>= 16 Bad WAFL)' axis x1y1 with lines, \
"Micron_all" using (($1+1)*pe_cnt):(((256-$34)*100)/256) smooth bezier title '(>= 32 Bad WAFL)' axis x1y1 with lines, \
"Micron_all" using (($1+1)*pe_cnt):(((256-$36)*100)/256) smooth bezier title '(>= 64 Bad WAFL)' axis x1y1 with lines, \
"Micron_all" using (($1+1)*pe_cnt):(($14*400)/$5) smooth bezier title '(Uncorrectable WAFL)' axis x1y2 with lines, \
"Micron_all" using (($1+1)*pe_cnt):(($70*100)/$5) smooth bezier title '(Correctable WAFL)' axis x1y2 with lines
【问题讨论】:
-
你能发一个small, self-contained example吗?这将使您更容易找出问题所在,对他人和您自己都是如此。
-
@that_other_guy 我已经减少了代码,但我仍然遇到同样的错误。我不知道为什么会这样。我有另一个脚本与这个脚本相同,但可以正常工作。
-
好的,所以当我评论“set xtics add (pe_cnt)”行时错误消失了,但是谁能告诉我为什么我会收到错误?我检查过了,语法是正确的。