You can change __init__the AutoLocator method to your function before any chart:
import pylab as pl
from matplotlib import ticker
def AutoLocatorInit(self):
ticker.MaxNLocator.__init__(self, nbins=4, steps=[1, 2, 5, 10])
ticker.AutoLocator.__init__ = AutoLocatorInit
pl.plot(pl.randn(100))
pl.figure()
pl.hist(pl.randn(1000), bins=40)
pl.show()
source
share