title: Inverting y axis of datetimes in Python
body: <p>I'm trying to produce a graph with datetime objects on the y axis, increasing from top to bottom. <a href="https://stackoverflow.com/a/5806656/4718223">This answer</a> suggests using invert_yaxis(), which throws 'ValueError: No sensible date limit could be found in the AutoDateLocator.' Setting ymin and ymax manually gives the same result. What am I missing?</p>
  
  <p>Thanks in advance!</p>
  
  <p>Edit: I'm using matplotlib 1.3.1 on Python 2.7.</p>
  
  <pre><code>import numpy
  import matplotlib.pyplot as plt
  import datetime
  
  #set up x and y
  dates = dates = [datetime.datetime(2015, 3, 12), datetime.datetime(2015, 3, 15), datetime.datetime(2015, 3, 17), datetime.datetime(2015, 3, 21), datetime.datetime(2015, 3, 9), datetime.datetime(2015, 3, 16)]
  x = numpy.arange(0, len(dates), 1)
  
  plt.figure()
  plt.plot(x, dates)
  plt.gca().invert_yaxis() #this is the bit that isn't working!
  plt.show()
  </code></pre>