title: How to plot predicted values with actual values when we have multi-index
body: <p>I am having time-series data I am trying to predict spot prices for next-day. My data looks like:<a href="https://i.stack.imgur.com/ExK4r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ExK4r.png" alt="enter image description here"></a> </p>
  
  <p>I did groupby on f_area and I end up with multiindex. Now I am trying to do predictions using RandomForestRegressor.</p>
  
  <pre><code>from sklearn.model_selection import train_test_split
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.metrics import mean_squared_error
  
  y = area3['y'].values
  X = area3[['f_price', 'day_of_week', 'day_of_month']]
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20, random_state=42)
  
  model = RandomForestRegressor()
  model = model.fit(X_train, y_train)
  y_pred = model.predict(X_test)
  </code></pre>
  
  <p>Now when I try to plot y_test(actual values) and y_pred(predicted values)</p>
  
  <pre><code>fig, ax = plt.subplots()
  ax.plot(y_test)
  ax.plot(y_pred)
  </code></pre>
  
  <p>I got this graph.
  <a href="https://i.stack.imgur.com/Nbgl6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Nbgl6.png" alt="enter image description here"></a></p>
  
  <p>What I want need is to have date on X axis and I am unable to so it because of the multi-index. How can I do this or remove the multiindex? I tried to remove the multiindex via reset_index but it doesn't work in my case Thanks</p>