title: Sample linear interpolation of data file
body: <p>I have a data file <code>example.dat</code> with xy values, for example</p>
  
  <pre><code>0 10
  1 40
  5 20
  </code></pre>
  
  <p>How can I sample the linear interpolation of these points in <code>gnuplot</code>? I want to store that sampling in another file <code>output.dat</code> using <code>set table</code>. With cubic spline smoothing I can do</p>
  
  <pre><code>set table "output.dat"
  set samples 10
  plot "example.dat" smooth csplines
  </code></pre>
  
  <p>which yields an equidistant sampling of the cubic spline interpolation with 10 points. But I found no way to have such an equidistant sampling with linear interpolation: The sampling rate is just ignored (gnuplot 5.0).</p>
  
  <p>I tried without any options and with linear interpolation "smoothing", like <code>smooth unique</code>, hoping that this would make gnuplot think of the dataset as a function which can be sampled, but to no avail.</p>
  
  <p>My application is sampling different data files at a common grid for later comparison. I am aware that this is pushing the boundaries of what gnuplot is intended for, but since there is already a sampling mechanism I wonder if I am simply missing something.</p>