import matplotlib.dates as mdates myFmt = mdates.DateFormatter('%d') ax.xaxis.set_major_formatter(myFmt)