title: Using "plot for" in gnuplot to vary parameters
body: <p>I want to use the <code>plot for</code> feature in gnuplot to plot functions with varying parameters. Here an example</p>
  
  <pre><code>par = "1 2" #two values for the parameter
  f(x,a) = sin(a*x)
  g(x,a) = cos(a*x)
  plot for [i=1:words(par)]  g(x, word(par,i)), f(x, word(par,i))
  </code></pre>
  
  <p>What I expect is the plotting of the four functions <code>g(x,1)</code>, <code>g(x,2</code>, <code>f(x,1)</code>, and <code>f(x,2)</code>.</p>
  
  <p>But for whatever reason only three functions are plotted, namely: <code>g(x,1)</code>, <code>g(x,2</code>, and <code>f(x,2)</code>.</p>
  
  <p>This seems completely arbitrary to me.</p>
  
  <p>Can someone help me out?</p>