title: Matplotlib DatetimeIndex Error - None of the values are in the columns
body: <p>I have taken some csv data that is in a daily date format resampled that data to monthly and now want to visualize with matplotlib. However, when I try to plot the resampled timeseries data I am running into the following error and am not sure how to proceed. I have tried referencing both <code>df.index</code> and <code>df.index.values</code> to no success</p>
  
  <pre><code>KeyError: "None of [DatetimeIndex(['2019-02-28', '2019-03-31',\n               '2019-04-30', '2019-05-31', '2019-06-30', '2019-07-31',\n               '2019-08-31', '2019-09-30', '2019-10-31', '2019-11-30',\n               '2019-12-31', '2020-01-31'],\n              dtype='datetime64[ns]', freq=None)] are in the [columns]"
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code># Libraries
  import pandas as pd
  import matplotlib
  import matplotlib.pyplot as plt
  
  %matplotlib inline
  
  df = pd.read_csv('tv-sales.csv', parse_dates=['Date'], index_col='Date')
  
  df.info()
  
  &lt;class 'pandas.core.frame.DataFrame'&gt;
  DatetimeIndex: 365 entries, 2019-02-01 to 2020-01-31
  Data columns (total 6 columns):
   #   Column               Non-Null Count  Dtype  
  ---  ------               --------------  -----  
   0   Spend                365 non-null    float64
   1   Traffic              365 non-null    int64  
   2   Sales                365 non-null    int64  
  
  # Resample to Months
  df = df.resample('M').sum()
  
  df.index
  
  DatetimeIndex(['2019-02-28', '2019-03-31',
                 '2019-04-30', '2019-05-31', '2019-06-30', '2019-07-31',
                 '2019-08-31', '2019-09-30', '2019-10-31', '2019-11-30',
                 '2019-12-31', '2020-01-31'],
                dtype='datetime64[ns]', name='Date', freq='M')
  
  # Visualize
  
  ax = df.plot(x=df.index.values, y='Spend', legend=False)
  </code></pre>