title: Determine min and max in gnuplot
body: <p>I am new to gnuplot and i am trying to determine the mina nd max from a datafile and afterwards plot the data</p>
  
  <p>So far I have managed to determine the min and max like this:</p>
  
  <pre><code># Define two helper functions
  ismin(x) = (x&lt;min)?min=x:0
  ismax(x) = (x&gt;max)?max=x:0
  
  # Initialise the 'global' vars
  max=-1e38
  min=1e38
  
  plot "Data.txt" u 0:(ismin($3)*ismax($3))
  </code></pre>
  
  <p>The problem is that I am trying to plot the data using splot, and it's not working.</p>
  
  <p>I am trying this:</p>
  
  <pre><code>splot \
  'Data.txt' u 2:1:3 with pm3d t '',\
  </code></pre>
  
  <p>If I remove the part related to determining the min and max, the splot command works.</p>
  
  <p>Any suggestions?</p>