plt.close('all') fig, ax = plt.subplots(1) ax.plot(r.date, r.close) # rotate and align the tick labels so they look better fig.autofmt_xdate() # use a more precise date string for the x axis locations in the # toolbar import matplotlib.dates as mdates ax.fmt_xdata = mdates.DateFormatter('%Y-%m-%d') plt.title('fig.autofmt_xdate fixes the labels')