title: gnuplot - how to convert read time format to double/float/use it as function parameter
body: <p>I've got a problem with read-in time values in gnuplot. I have a data file</p>
  
  <pre><code>#data.dat
  00:50.254
  00:50.435
  00:51.356
  00:53.245
  00:54.730
  ...
  </code></pre>
  
  <p>with format <code>'%M:%S'</code>. So I'm reading it in with my gnuplot file:</p>
  
  <pre><code>set xdata time
  set timefmt "%M:%S"
  set xtics format "%M:%S"
  
  set grid
  set xrange [ 0:"01:30" ]
  set yrange [0:10]
  set xtics "00:00",10,"01:30"
  set mxtics 2
  set ytics 0,2,10
  set mytics 2
  
  p 'data.dat' u 1:1
  </code></pre>
  
  <p>Here I want to plot the data really <code>1:1</code> as a test. The result is: I will get just the value of '%M' as y-value. This can be corrected by using <code>set ydata time</code>. But I want to do some calculation with the time data and need the seconds (or seconds including minutes, sth. like <code>%M*60+%S</code>: 01:30->90). I want to pass it to a function, or in my special case: summing it up with <code>smooth freq</code> after some calculation in a function:</p>
  
  <pre><code>bin(x) = floor(x+0.5)
  p 'data.dat' u (bin($1)):(1.0) smooth freq w boxes
  </code></pre>
  
  <p>How can I access the <code>%S</code> part of the time?<br>
  How can I convert a read-in time to a double/float?</p>
  
  <p>Thank you for your help in advance!</p>
  
  <p>edit: I got an idea right after posting: is the read-in data an array and I can read out this array? I'll try it out.</p>
  
  <p>edit2: <code>internal error : non-STRING argument</code>... This did not work<br>
  In my special case, I could maybe use <code>:</code> as delimiter and just read out the mins and secs as two colums... I'll give it a try too. But this wont help, if there are more columns with other data that needs to be plotted...</p>
  
  <p>edit3: Even setting the delimiter (<code>separator</code>) doesn't solve the problem yet, but an error message occurs:
  <code>Bad format character</code> at my <code>plot</code> line.<br>
  Here my new gnuplot command file:</p>
  
  <pre><code>set datafile separator ':'
  
  set timefmt "%M:%S"
  set xtics format "%M:%S"
  
  set grid
  #set xrange [ 0:"01:30" ]
  set xrange [0:90]
  set yrange [0:92]
  #set xtics "00:00",10,"01:30"
  set xtics 0,10,90
  set mxtics 2
  set ytics 0,2,10
  set mytics 2
  
  p 'data.dat' #u 1:2 #($1*60+$2):($2)
  </code></pre>