Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 24de3e9

Browse files
committed
ENH: have get_*_ticks respect overlap filtering by default
This will make sure extra ticks (that will not be used) will not be returned. The change to `get_major_ticks` is a no-op, but done for symmetry.
1 parent 964e8cd commit 24de3e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/axis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ def get_minor_formatter(self):
14051405
def get_major_ticks(self, numticks=None):
14061406
'Get the tick instances; grow as necessary.'
14071407
if numticks is None:
1408-
numticks = len(self.get_major_locator()())
1408+
numticks = len(self.get_majorticklocs())
14091409

14101410
while len(self.majorTicks) < numticks:
14111411
# Update the new tick label properties from the old.
@@ -1419,7 +1419,7 @@ def get_major_ticks(self, numticks=None):
14191419
def get_minor_ticks(self, numticks=None):
14201420
'Get the minor tick instances; grow as necessary.'
14211421
if numticks is None:
1422-
numticks = len(self.get_minor_locator()())
1422+
numticks = len(self.get_minorticklocs())
14231423

14241424
while len(self.minorTicks) < numticks:
14251425
# Update the new tick label properties from the old.

0 commit comments

Comments
 (0)