I have a dataframe that I am plotting with pandas working in ipython. I am importing the usual stuff, then plotting the dataframe
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
traydata_A[('x_TmId', 'Trays')].plot()
plt.xlabel('Hour of the day')
plt.ylabel('Number of picked/despatched trays')
and would like to get the actual data plotted by using (like e.g. in this question)
ax = plt.gca()
line = ax.lines[0]
The end result is
IndexError Traceback (most recent call last)
<ipython-input-220-d211b85302a5> in <module>()
1 ax = plt.gca()
----> 2 line = ax.lines[0]
IndexError: list index out of range
what am I doing wrong? I am sure I have a deep misunderstanding of how pandas connects to matplotlib!