title: In Gnuplot, how to plot a function many times on the same plot in a for loop
body: <p>In gnuplot, I'm trying to plot a function with 5 parameters, whose values are stored in an external file, 8 times on the same graph. I want to plot the vapor pressure of 8 species as a function of temperature; the vapor pressure is parametrized by 5 variables. I have tried using a <code>do-for</code> loop, but that only plots one species. How can I plot the function 8 times on the same plot using the 8 sets of parameters? The code below is based on <a href="https://stackoverflow.com/a/17841152/2449192">this answer</a>, and works except that the answer as given will print 8 pngs, but I would like 1, and modified it in my attempt to do so.</p>
  
  <p><code>parameters.txt</code></p>
  
  <pre><code>A   B   C   D   E
  33.634  -3647.9 -8.6428 -9.69E-11   1.19E-06
  19.419  -5869.9 -0.4428 -1.26E-02   5.22E-06
  -15.077 -4870.2 14.501  -3.16E-02   1.35E-05
  76.1    -5030   -25.078 9.76E-03    -2.58E-13
  2.1667  -2631.8 4.035   -1.18E-02   6.10E-06
  39.917  -4132   -10.78  1.97E-10    2.04E-06
  29.89   -3953.5 -7.2253 2.11E-11    8.96E-07
  99.109  -7533.3 -32.251 1.05E-02    1.23E-12
  </code></pre>
  
  <p><code>vapor.plt</code></p>
  
  <pre><code>reset
  datafile = "parameters.txt"
  
  set terminal pngcairo
  set xrange [273.15:493.15]
  set logscale y
  set output "vapor.png"
  do for [step=1:8] {
      # read parameters from file, where the first line is the header, thus the +1
      a=system("awk '{ if (NR == " . step . "+1) printf \"%f\", $1}' " . datafile)
      b=system("awk '{ if (NR == " . step . "+1) printf \"%f\", $2}' " . datafile)
      c=system("awk '{ if (NR == " . step . "+1) printf \"%f\", $3}' " . datafile)
      d=system("awk '{ if (NR == " . step . "+1) printf \"%f\", $4}' " . datafile)
      e=system("awk '{ if (NR == " . step . "+1) printf \"%f\", $5}' " . datafile)
  
      # convert parameters to numeric format
      a=a+0.
      b=b+0.
      c=c+0.
      d=d+0.
      e=e+0.
  
      plot 10**(a + b/x + c*log10(x) + d*x + e*x**2) title ''
  }
  set output
  </code></pre>