currently i have this code:
def graph_s(self):
ex_list = list()
time = list()
if(len(self.sheet) > 1):
for index, row in self.sheet.iterrows():
ts = date(int(row['Year']), int(row['Month']), 1)
time.append(ts)
ex_list.append(float(row['grocery']) + float(row['transportation']) + float(row['leisure']) + float(row['utilities']) + float(row['savings']) + float(row['bills']))
z = sorted(zip(time,ex_list))
x=[date(2021,i,1) for i in z]
y=[i[1] for i in z]
plt.plot(x, y)
plt.show()
main()
else:
print('Sorry! There is not enough information to create a graph of you spending over time.')
main()
but the graph isnt what i wanted. i want to change the x-axis to a nicer version e.g. 2021-10, i want to omit the day