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

Skip to content

Commit 62d32ba

Browse files
committed
Use 'auto' instead of None
1 parent 2517eb4 commit 62d32ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/ticker.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ class MaxNLocator(Locator):
13331333
"""
13341334
Select no more than N intervals at nice locations.
13351335
"""
1336-
default_params = dict(nbins=None,
1336+
default_params = dict(nbins='auto',
13371337
steps=None,
13381338
trim=True,
13391339
integer=False,
@@ -1346,7 +1346,7 @@ def __init__(self, *args, **kwargs):
13461346
13471347
*nbins*
13481348
Maximum number of intervals; one less than max number of
1349-
ticks. If `None`, the number of bins will be
1349+
ticks. If the string `'auto'`, the number of bins will be
13501350
automatically determined based on the length of the axis.
13511351
13521352
*steps*
@@ -1414,7 +1414,7 @@ def set_params(self, **kwargs):
14141414

14151415
def bin_boundaries(self, vmin, vmax):
14161416
nbins = self._nbins
1417-
if nbins is None:
1417+
if nbins == 'auto':
14181418
nbins = self.axis.get_tick_space()
14191419
scale, offset = scale_range(vmin, vmax, nbins)
14201420
if self._integer:
@@ -1894,7 +1894,7 @@ def __init__(self):
18941894
if rcParams['_internal.classic_mode']:
18951895
nbins = 9
18961896
else:
1897-
nbins = None
1897+
nbins = 'auto'
18981898
MaxNLocator.__init__(self, nbins=nbins, steps=[1, 2, 5, 10])
18991899

19001900

0 commit comments

Comments
 (0)