title: Curve Fitting to a time series in the format 'datetime'?
body: <p>Here is my problem: <code>polyfit</code> does not take datetime values, so that I converted datetime with <code>mktime</code> producing the polynomial fit works</p>
  
  <pre><code>z4 = polyfit(d, y, 3) 
  p4 = poly1d(z4)
  </code></pre>
  
  <p>For the plot however, I would like the datetime description on the axis and didn't # figure out how to do that. Can you help me?</p>
  
  <pre><code>fig = plt.figure(1)
  cx= fig.add_subplot(111) 
  
  xx = linspace(0,  d[3], 100)
  pylab.plot(d, y, '+', xx, p4(xx),'-g')
  cx.plot(d, y,'+', color= 'b', label='blub')
  plt.errorbar(d, y,
             yerr,
             marker='.',
             color='k',
             ecolor='b',
             markerfacecolor='b',
             label="series 1",
             capsize=0,
             linestyle='')
  
  cx.grid()
  cx.set_ylim(0,0.03)
  plt.show()
  </code></pre>
  
  <p>rest of the code:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  from matplotlib import axis
  from datetime import datetime
  from numpy import *
  import pylab
  import time
  </code></pre>
  
  <p>my first 4 time data points</p>
  
  <pre><code>x = [datetime(1978, 7, 7), 
       datetime(1980, 9, 26), 
       datetime(1983, 8, 1), 
       datetime(1985,8,8)]
  
  d=[]
  for i in x:
      d.append(time.mktime(i.timetuple()))
  </code></pre>
  
  <p>my first 4 data values</p>
  
  <pre><code>y = [0.00134328779552718,
       0.00155187668863844,
       0.0039431374327427,
       0.00780037563783297]
  </code></pre>
  
  <p>my calculated standard deviations for error bars</p>
  
  <pre><code>yerr = [0.0000137547160254577,
          0.0000225670232594083,
          0.000105623642510075,
          0.00011343121508]
  </code></pre>