Oct-17-2018, 01:27 PM
Hi,
Your code seems to work on my computer. I just have change the xls typ eto csv. You might want to try that line to import csv:
df = pd.read_csv(csv_source)
What version of matplotlib do you use?
Otherwise I would suggest you to build your figure like this:
f, ax = plt.subplots(1)
So you don't have to use ax = plt.gca(). Then continue:
df.plot(kind='line', x='Ship Date', y='Profit', color='red', ax=ax)
df.plot(kind='line', x='Ship Date', y='Sales', color='blue', ax=ax)
plt.show()
But I doubt that is the root cause of the error message you got, it's more like a workaround...
Your code seems to work on my computer. I just have change the xls typ eto csv. You might want to try that line to import csv:
df = pd.read_csv(csv_source)
What version of matplotlib do you use?
Otherwise I would suggest you to build your figure like this:
f, ax = plt.subplots(1)
So you don't have to use ax = plt.gca(). Then continue:
df.plot(kind='line', x='Ship Date', y='Profit', color='red', ax=ax)
df.plot(kind='line', x='Ship Date', y='Sales', color='blue', ax=ax)
plt.show()
But I doubt that is the root cause of the error message you got, it's more like a workaround...