title: How do I plot my datetime on the x axis when this value is used as index?
body: <p>I have a short question.</p>
  <p>This is my dataframe:</p>
  <pre><code>                     gradient  result
  date                                 
  2022-04-15 09:43:20  0.206947    0.10
  2022-04-15 10:25:00  0.102620    0.10
  2022-04-15 11:06:40  0.019450    0.06
  2022-04-15 11:48:20  0.025945    0.08
  2022-04-15 12:30:00  0.022455    0.08
                        ...     ...
  2022-05-02 14:13:20  0.003770    0.02
  2022-05-02 14:55:00  0.084120    0.10
  2022-05-02 15:36:40  0.134970    0.10
  2022-05-02 16:18:20  0.261385    0.10
  2022-05-02 17:00:00  0.955833     NaN
  </code></pre>
  <p>And the data types are:</p>
  <pre><code>gradient    float64
  result      float64
  dtype: object
  </code></pre>
  <p>So I want and have the date as index. But now I want to plot the gradient on the (y-axis) and the date on the (x-axis):</p>
  <pre><code>x = data_646_mean.gradient
  y = data_646_mean.date
  </code></pre>
  <p>But this give me the following error:</p>
  <pre><code>AttributeError: 'DataFrame' object has no attribute 'date'
  </code></pre>
  <p>Does anyone know how to solve this error? I really hope I don't need to change my whole script to get the date out of the index.</p>
  <p>Thank you for reading!</p>
  <p>p.s. I already did what Andreas Deak suggest, but this does not work.</p>
  <p>input:</p>
  <pre><code>x = data_646.mean.index
  y = data_646.mean.gradient
  
  plt.plot(x, y, 'o', color='black');
  </code></pre>
  <p>output:</p>
  <pre><code>AttributeError: 'function' object has no attribute 'index'
  </code></pre>