title: Plot pandas dataframe index formatted as Month-Year on x axis
body: <p>I have a dataframe that I want the x axis to show as APR-2018 for example.  The ax.format_xdata line does not do the trick.</p>
  
  <pre><code>import datetime as dt
  import pandas as pd
  import time
  import matplotlib.pyplot as plt
  import matplotlib.dates as mdates
  
  data = {("IVOG",1493510400000):{"Adj_Close":119.2136,"MA(3)":119.2136,"EWMA(3)":119.2136},
          ("IVOG",1496188800000):{"Adj_Close":120.8236,"MA(3)":120.0186,"EWMA(3)":120.0454},
          ("IVOG",1498780800000):{"Adj_Close":120.2736,"MA(3)":120.1036,"EWMA(3)":120.1266},
          ("IVOG",1501459200000):{"Adj_Close":121.7836,"MA(3)":120.5236,"EWMA(3)":120.5832},
          ("IVOG",1504137600000):{"Adj_Close":120.3536,"MA(3)":120.4896,"EWMA(3)":120.5309},
          ("IVOG",1506729600000):{"Adj_Close":124.3336,"MA(3)":121.1303,"EWMA(3)":121.2749}}
  
  df=pd.DataFrame.from_dict(data, orient = 'index')
  print(df)
  ax = plt.gca()      # get current axis
  df.plot(kind='line',y='Adj_Close', ax=ax)
  df.plot(kind='line',y='MA(3)',ax=ax)
  df.plot(kind='line',y='EWMA(3)', color='green', ax=ax)
  print(df.index[0][1])
  ax.format_xdata = mdates.DateFormatter('%b-%Y')     # Trying to get APR-2018
  plt.xlabel(df.index[0][0])     # Trying to Get the Ticker
  _=plt.grid()
  _=plt.xticks(rotation=90)
  plt.show()
  </code></pre>
  
  <p>The second index should be just the date and not time, but it <em>incorrectly</em> plots like this:<a href="https://i.stack.imgur.com/BfiEr.png" rel="nofollow noreferrer">Incorrect Plot</a></p>