I have a graph which plots the scores across a week
At the minute I am using a simple incrementor to plot the x axis
percent = []
count = 0
time = []
for x, y in zip(counts100, counts):
percent.append(float(x/y))
time.append(count)
count += 1
plt.xlabel('weekday')
plt.ylabel('% score over 100')
plt.plot( time, percent )
plt.gcf().autofmt_xdate()
plt.show()
This displays the data correctly, however the x axis only reads the numbers.
How can I convert this to weekdays? Thanks
EDIT: I found this answer here and I am trying to fit it to my problem and it almost works but I keep getting weird errors
File "/usr/local/lib/python3.5/dist-packages/matplotlib/dates.py", line 401, in num2date
return _from_ordinalf(x, tz)
File "/usr/local/lib/python3.5/dist-packages/matplotlib/dates.py", line 254, in _from_ordinalf
dt = datetime.datetime.fromordinal(ix).replace(tzinfo=UTC)
ValueError: ordinal must be >= 1