I am trying to plot number of sales on Y axis against the dates on the X axis. I can't seem to work out a way to do the dates on the X axis. If i change the dates to a float, it I can plot it but I still cannot figure out a way to plot the date format.
import matplotlib.pyplot as plt
import csv
x = []
y = []
with open('book1.csv','r') as csvfile:
plots = csv.reader(csvfile, delimiter=',')
for row in plots:
x.append(float(row[0]))
y.append(float(row[1]))
plt.plot(x,y, label='Loaded from file!')
plt.xlabel('x')
plt.ylabel('y')
plt.title('Interesting Graph\nCheck it out')
plt.legend()
plt.show()
My csv looks something like:
1/1/2019,7980.185714
2/1/2019,9478.297619
3/1/2019,9282.166667
4/1/2019,6900.833333
5/1/2019,5563.716667
