Tick formatters control the formats of tick labels. It is used similarly to tick locators, as follows:
ax.xaxis.set_major_formatter(xmajorFormatter)
ax.xaxis.set_minor_formatter(xminorFormatter)
ax.yaxis.set_major_formatter(ymajorFormatter)
ax.yaxis.set_minor_formatter(yminorFormatter)