Quite often I want to make a bar chart of counts. If the counts are low I often get major and/or minor tick locations that are not integers. How can I prevent this? It makes
You can use the MaxNLocator method, like so:
MaxNLocator
from pylab import MaxNLocator ya = axes.get_yaxis() ya.set_major_locator(MaxNLocator(integer=True))