title: Reading dataset value into a gnuplot variable (start of X series)
body: <p>I originally thought this may be the same as <a href="https://stackoverflow.com/questions/6089293/start-of-x-series">gnuplot - start of X series - Stack Overflow</a> - but I think this is slightly more specific. </p>
  
  <p>Since I'm interested in finding the "start of X series", so to speak - I'll try to clarify with an example; say you have this script: </p>
  
  <pre><code># generate data
  system "cat &gt; ./inline.dat &lt;&lt;EOF\n\
  10.0 1 a 2\n\
  10.2 2 b 2\n\
  10.4 3 a 2\n\
  10.6 4 b 2\n\
  10.8 5 c 7\n\
  11.0 5 c 7\n\
  EOF\n"
  
  # ranges 
  set yrange [0:8]
  set xrange [0:11.5]
  
  plot "inline.dat" using 1:2 with impulses linewidth 2
  </code></pre>
  
  <p>If you plot it, you'll notice the data starts from 10 on x-axis: </p>
  
  <p><img src="https://i.stack.imgur.com/GRe40.png" alt="gnuplot-startx.png"></p>
  
  <p>Now, of course you can adjust the <code>xrange</code> - but sometimes you're interested in "relative positions" which start "from 0", so to speak. Therefore, one would like to see the data "moved left" on the x-axis, so it starts at 0. Since we know the data starts at 10.0, we could subtract that from first column explicitly:</p>
  
  <pre><code>plot "inline.dat" using ($1-10.0):2 with impulses linewidth 2
  </code></pre>
  
  <p>... and that basically does the trick. </p>
  
  <p>But say you <em>don't</em> want to specify the "10.0" explicitly in the <code>plot</code> command above; then - knowing that it is the first element of the first column of the data which is already loaded, one would hope there is a way to somehow read this value in a variable - say, with something like the following pseudocode: </p>
  
  <pre><code>varval = "inline.dat"(1,1) # get first element of first column in variable
  plot "inline.dat" using ($1-varval):2 with impulses linewidth 2
  </code></pre>
  
  <p>... and with something like this, one wouldn't have to specify this "x offset" value, so to speak, manually in the plot command. </p>
  
  <p>So - to rephrase - is there a way to read the start of x series (the first value of a given column in a dataset) as a variable in <code>gnuplot</code>? </p>