I've always found the matplotlib locators and formatters to be uneasy to use for many practical purposes, so if the links given by Mad Physicist do not suit you, you can just set them manually:
n, m = data.shape
ax.set_xticks(np.linspace(0, n-1, n))
ax.set_xticklabels(["%.1f" % i for i in np.linspace(0, 100, n)])
to format the xaxis from 0 to 100 with ticks on the middle of the squares, or
n, m = data.shape
ax.set_xticks(np.linspace(-0.5, n-0.5, n+1))
ax.set_xticklabels(["%.1f" % i for i in np.linspace(0, 100, n+1)])
for ticks on the left/right sides of the squares.
Note that the "%.1f"
is used to format the string to a float with 1 zero after the comma (see e.g. here); you can use "%d"
if you want integers.