title: Draw fit functions for multiple cases
body: <p>I have a data file in which two cases are separated with headers such as <code>ncell=...</code>. I draw these data points with</p>
  
  <pre><code>plot for [IDX=0:1] "file.dat" i IDX u 1:2 w lines title columnheader(1)
  </code></pre>
  
  <p>I would like to fit these data points into functions (does not matter which for now), get the parameters for each case and draw fit functions  instead of actual data points. I am aware of <a href="http://gnuplot.sourceforge.net/docs_4.2/node82.html" rel="nofollow noreferrer">fit function</a> but I don't know how to use it when data file contains multiple cases.</p>
  
  <p><strong>file.dat</strong>:</p>
  
  <pre><code>ncell=1000000
  8 46.42716
  12 27.6141
  16 23.77418
  20 20.81404
  24 21.55132
  28 22.70293
  32 19.75053
  
  
  ncell=3000000
  8 188.0772
  12 101.4686
  16 72.4076
  20 76.0597
  24 61.2208
  28 61.44395
  32 62.1787
  </code></pre>