title: How to use the integers 1 to n as a column when plotting a data file with Gnuplot?
body: <p>Let's assume I have  a file "data.dat" like this:</p>
  
  <pre><code>#Time          Velocity
  1              24
  1              26
  1              28
  </code></pre>
  
  <p>Now, I need to plot column 2 in gnuplot. It has to be plotted over the natural numbers from 1 to n, so in this case from 1 to 3. In general I could use the following gnuplot with the following:</p>
  
  <pre><code>plot "data.dat" using 1:2
  </code></pre>
  
  <p>but I do not want to use column 1, but the numbers 1 to 3. How do I do that in a clever, gnuplot-internal way? If that is not possible, what is the best way using bash for adding a column that goes from 1 to 3 (after using sth. like <code>cat data.dat | awk '{ print $2 }' &gt; new_data.dat</code> to column 2 from data.dat)?</p>