title: Python - Trouble plotting datetime index with pandas and matplotlib
body: <p>I'm loading a data file, extracting certain columns, and plotting them to PDF with matplotlib.</p>
  
  <p>When I load my data file it into Pandas, I get a DateTimeIndex. If I plot the data in this form, all goes well.</p>
  
  <p>The problem arises when I select a subset of the data based on the time, ie:</p>
  
  <pre><code>data = data.ix[data.index &gt;= start_time]
  data = data.ix[data.index &lt;= end_time]
  </code></pre>
  
  <p>Now when I go to plot the data, pandas seems to have changed something because the DateTimeIndex is an array of npdatetime64 types, which are apparently unsupported by matplotlib and throw an error. (something in datetime.fromordinal)</p>
  
  <p>How can I get around this problem?</p>
  
  <p>I've tried plotting:</p>
  
  <pre><code>data.index.value.astype(datetime)
  </code></pre>
  
  <p>But this still throws an error within matplotlib! (Python int can't be converted to C long)</p>
  
  <p>Is there a way I can prevent pandas for ruining the data in the first place when I ix it?</p>
  
  <p>I'm using Python 2.7, Numpy 1.7, pandas 0.11, matplotlib 1.2.1.</p>
  
  <p>EDIT: It seems that I am experiencing the same problem as seen here:
  <a href="https://stackoverflow.com/questions/11376080/plot-numpy-datetime64-with-matplotlib?rq=1">Plot numpy datetime64 with matplotlib</a></p>