diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index 5e09dde41b2..6f1e35b7cfd 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -1924,8 +1924,7 @@ def __init__(self): class AutoMinorLocator(Locator): """ Dynamically find minor tick positions based on the positions of - major ticks. Assumes the scale is linear and major ticks are - evenly spaced. + major ticks. The scale must be linear with major ticks evenly spaced. """ def __init__(self, n=None): """ @@ -1939,6 +1938,11 @@ def __init__(self, n=None): def __call__(self): 'Return the locations of the ticks' + if self.axis.get_scale() == 'log': + warnings.warn('AutoMinorLocator does not work with logarithmic ' + 'scale') + return [] + majorlocs = self.axis.get_majorticklocs() try: majorstep = majorlocs[1] - majorlocs[0]