title: Plotting multiple graphs using index to data from array
body: <p>Using Version 5.2 patchlevel 2, I tried the following plot:</p>
  
  <pre><code>gnuplot&gt; set xdata time
  gnuplot&gt; set timefmt "%s"
  gnuplot&gt; array lr_a[100];array lr_b[100]
  gnuplot&gt; plot "free.dat" using 2:(i=stringcolumn(0)+1,lr_a[i]=$13,lr_b[i]=$14,$10) with linesp title columnheader(1)
  gnuplot&gt; print i
  13
  gnuplot&gt; print lr_a
  [-452057.0,-178648.0,9568.53,10688.5,11016.6,11142.9,11137.5,12296.8,12467.0,-147009.0,-18170.2,-17176.1,-6493.16,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]
  gnuplot&gt; print lr_b
  [0.000292381,0.000119527,5.32936e-07,-1.75101e-07,-3.82532e-07,-4.62388e-07,-4.58968e-07,-1.19192e-06,-1.29956e-06,9.95245e-05,1.80699e-05,1.74415e-05,1.06875e-05,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]
  </code></pre>
  
  <p>Now I want to add plots using those arrays:</p>
  
  <pre><code>j=1
  gnuplot&gt; replot "free.dat" using 2:(lr_a[j]+lr_b[j]*$2) with linesp title "LR#".j
  </code></pre>
  
  <p>It worked, however when I try to add more plots like this
  <a href="https://i.stack.imgur.com/QgKzj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QgKzj.png" alt="Initial plot"></a></p>
  
  <pre><code>gnuplot&gt; j=j+1;replot "free.dat" using 2:(lr_a[j]+lr_b[j]*$2) with linesp title "LR#".j
  gnuplot&gt; j=j+1;replot "free.dat" using 2:(lr_a[j]+lr_b[j]*$2) with linesp title "LR#".j
  gnuplot&gt; print j
  3
  </code></pre>
  
  <p>The plots are all the same, labeled <code>LR#3</code>.
  <a href="https://i.stack.imgur.com/NtD6e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NtD6e.png" alt="Additional plots"></a></p>
  
  <p>Why is that so?</p>
  
  <p>For reference, here's (a rather useless) <code>free.dat</code>:</p>
  
  <pre><code>/home   1581728983       51175       51175           0       51175           0           1       51175     10411.5     10411.5           0     10411.5           0           1     10411.5
  /home   1581729050       51175       51175           0       51175           0           1       51175     10411.5     10411.5  0.00976562     -452057  0.000292381    1.00299     10411.5
  /home   1581729142       51175       51175           0       51175           0           1       51175     10411.5     10411.5  0.00920748     -178648  0.000119527    0.83085     10411.5
  /home   1581730106       51175       51175           0       51175           0           1       51175     10411.5     10411.5  0.00799351     9568.53  5.32936e-07  0.0304721     10411.5
  /home   1581730231       51175       51175           0       51175           0           1       51175     10411.5     10411.5  0.00715961     10688.5  -1.75101e-07    -0.0133904     10411.5
  /home   1581730248       51175       51175           0       51175           0           1       51175     10411.5     10411.5  0.00654339     11016.6  -3.82532e-07     -0.033421     10411.5
  /home   1581730649       51175       51175           0       51175           0           1       51175     10411.5     10411.5  0.00606222     11142.9  -4.62388e-07    -0.0487386     10411.5
  /home   1581730988       51175       51175           0       51175           0           1       51175     10411.5     10411.5  0.00567332     11137.5  -4.58968e-07    -0.0582907     10411.5
  /home   1581732515       51175       51175           0       51175           0           1       51175     10411.5     10411.5  0.00552427     12296.8  -1.19192e-06     -0.228729     10411.5
  /home   1581732849       51175       51175           0       51175           0           1       51175     10411.5     10411.5  0.00537109       12467  -1.29956e-06      -0.30963     10411.5
  /home   1581733526       51175       51175           0       51175           0           1       51175     10412.4     10411.6    0.258446     -147009  9.95245e-05   0.578522     10411.8
  /home   1581797054       51175       51175           0       51175           0           1       51175     10412.7     10411.7    0.406035    -18170.2  1.80699e-05   0.818011     10412.8
  /home   1581799764       51175       51175           0       51175           0           1       51175     10412.7     10411.7    0.482222    -17176.1  1.74415e-05   0.884514     10412.8
  /home   1581802740       51175       51175           0       51175           0           1       51175     10411.5     10411.7    0.469488    -6493.16  1.06875e-05   0.646611     10412.3
  </code></pre>