def _test_restrict_to_integer():
    pylab.figure()
ax = pylab.subplot(1, 2, 1)
pylab.bar(list(range(1, 4)), list(range(1, 4)), align='center')
ticks_restrict_to_integer(ax.xaxis)
ticks_restrict_to_integer(ax.yaxis)
ax = pylab.subplot(1, 2, 2)
pylab.bar(list(range(1, 4)), list(range(100, 400, 100)), align='center')
ticks_restrict_to_integer(ax.xaxis)
ticks_restrict_to_integer(ax.yaxis)
_test_restrict_to_integer()
pylab.show()
Python matplotlib restrict to integer tick locations