title: gnuplot how to give column number to plot dynamically?
body: <p>I am automating a task to create small graphs using gnuplot. And I need to pass the column number from the datafile that is to be plotted</p>
  
  <pre><code>pfile=system("echo $file")
  colnum=system("echo $colnum")
  
  plot pfile using 4:(column(colnum)) title "slot1"
                       ^^^^^^^^^^^^
  </code></pre>
  
  <p><code>colnum</code> is being exported earlier as <code>export colnum=2</code></p>
  
  <p>I am getting error at the highlighted part. I tried using export/fetch by system command, but it didn't work either
  e.g. I tried <code>4:colnum</code>, got similar error </p>
  
  <pre><code>"./12.gnuplot.helper.pg", line 29: warning: Skipping data file with no valid points    
  plot pfile using 4:(column(colnum)) title "slot1"   
                                                  ^   
  "./12.gnuplot.helper.pg", line 29: x range is invalid
  </code></pre>