title: gnuplot: min and max values for arbitrary number of columns
body: <p>I'm trying to plot an arbitrary number of lines in a same plot. My data file is like the following:</p>
  
  <pre><code>1  10  15  20
  2  20  25  30
  3  30  35  40
  4  40  45  50
  5  50  55  60
  </code></pre>
  
  <p>I'm using multiplot to do this:</p>
  
  <pre><code>set multiplot
  do for [i=1:ny] {
         plot 'data.dat' u 1:i+1 with lines lc i title word(names,i)
  }
  unset multiplot
  </code></pre>
  
  <p>where <code>ny=3</code> in this example. As expected, the yrange of each plot is different, so the graph looks very messy. I'm trying to add</p>
  
  <pre><code>set yrange [ymin:ymax]
  </code></pre>
  
  <p>where <code>ymin=min(col2,col3,col4,...,coln)</code> is the minimum value among all the columns 2-n and <code>ymax</code> is the maximum value. However, I still don't know how to get <code>ymin</code> and <code>ymax</code>. The function <code>stats</code> allow me to get minimums and maximums for one or two columns at the same time, but no more. Even if I do this column by column, I still don't know how to get the maximum among n scalars.</p>
  
  <p>Any idea?</p>