I have made this graph in matplotlib notebook magic. I want to convert the datetimes into months as they seem messy like this. What to do?
I have made this graph in matplotlib notebook magic. I want to convert the datetimes into months as they seem messy like this. What to do?
The easiest way would probably be using the datetime module:
import datetime
x_values = [d.strftime("%b %y") for d in dates]
plt.plot(x_values, y_values)
Which outputs Jan 15 instead of 2015-01. If you want to plot the full year and month name, you can use "%B %Y".