title: GNUPLOT: invalid expression?
body: <p>I have a simple gnuplot script that plots a bunch of graphs. When I run it, it gives the following error:</p>
  
  <p>EDIT: I've reduced the length of the code considerably as per the suggestions</p>
  
  <pre><code>    ;
      set xrange [pe_cnt:range_high];
      set xtics xticks;
      set xtics add (pe_cnt) 
                                                                                   ^
  line 26: invalid expression 
  </code></pre>
  
  <p>I've spent a lot of time in trying to solve this. I'd really appreciate if anyone could help me on this. This is my code: </p>
  
  <pre><code>range_high="`awk '{for(i=1;i&lt;=NF;i++) if ($i=="--stop") print $(i+1)}' temp_info`"
  xticks="`awk '{for(i=1;i&lt;=NF;i++) if ($i=="--xticks") print $(i+1)}' temp_info`"
  pe_cnt = "`awk '{for(i=1;i&lt;=NF;i++) if ($i=="--pe_cnt") print $(i+1)}' temp_info`"
  rd_cnt = "`awk '{for(i=1;i&lt;=NF;i++) if ($i=="--rd_cnt") print $(i+1)}' temp_info`"
  
  
  ##################################################################################################
  # Gnuplot script file for plotting Micron &gt;= 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 '(&gt;= 1 Bad WAFL)'      axis x1y1 with lines, \
       "Micron_all"      using (($1+1)*pe_cnt):(((256-$33)*100)/256)  smooth bezier  title '(&gt;= 16 Bad WAFL)'      axis x1y1 with lines, \
       "Micron_all"      using (($1+1)*pe_cnt):(((256-$34)*100)/256)  smooth bezier  title '(&gt;= 32 Bad WAFL)'      axis x1y1 with lines, \
       "Micron_all"      using (($1+1)*pe_cnt):(((256-$36)*100)/256)  smooth bezier  title '(&gt;= 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
  </code></pre>