Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 590f042 commit cb5042dCopy full SHA for cb5042d
1 file changed
lib/matplotlib/ticker.py
@@ -1924,8 +1924,7 @@ def __init__(self):
1924
class AutoMinorLocator(Locator):
1925
"""
1926
Dynamically find minor tick positions based on the positions of
1927
- major ticks. Assumes the scale is linear and major ticks are
1928
- evenly spaced.
+ major ticks. The scale must be linear with major ticks evenly spaced.
1929
1930
def __init__(self, n=None):
1931
@@ -1939,6 +1938,10 @@ def __init__(self, n=None):
1939
1938
1940
def __call__(self):
1941
'Return the locations of the ticks'
+ if self.axis.get_scale() != 'linear':
1942
+ warnings.warn('AutoMinorLocator only works with linear scale')
1943
+ return []
1944
+
1945
majorlocs = self.axis.get_majorticklocs()
1946
try:
1947
majorstep = majorlocs[1] - majorlocs[0]
0 commit comments