def get_day(tick):
    date = dates[0] + datetime.timedelta(tick - ticks[0])
return date.strftime('%a')
ax = plt.subplot()
ax.plot(data.index, data.A)
ticks = ax.get_xticks()
ax.xaxis.set_major_formatter(FuncFormatter(lambda tick, _: get_day(tick)))
Format datetime labels to include weekday name for pandas plot