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

Skip to content

Commit 5b75d0b

Browse files
committed
Use 'auto' instead of None
1 parent 5a2f962 commit 5b75d0b

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
@@ -1337,7 +1337,7 @@ class MaxNLocator(Locator):
13371337
"""
13381338
Select no more than N intervals at nice locations.
13391339
"""
1340-
default_params = dict(nbins=None,
1340+
default_params = dict(nbins='auto',
13411341
steps=None,
13421342
trim=True,
13431343
integer=False,
@@ -1350,7 +1350,7 @@ def __init__(self, *args, **kwargs):
13501350
13511351
*nbins*
13521352
Maximum number of intervals; one less than max number of
1353-
ticks. If `None`, the number of bins will be
1353+
ticks. If the string `'auto'`, the number of bins will be
13541354
automatically determined based on the length of the axis.
13551355
13561356
*steps*
@@ -1418,7 +1418,7 @@ def set_params(self, **kwargs):
14181418

14191419
def bin_boundaries(self, vmin, vmax):
14201420
nbins = self._nbins
1421-
if nbins is None:
1421+
if nbins == 'auto':
14221422
nbins = self.axis.get_tick_space()
14231423
scale, offset = scale_range(vmin, vmax, nbins)
14241424
if self._integer:
@@ -1908,7 +1908,7 @@ def __init__(self):
19081908
if rcParams['_internal.classic_mode']:
19091909
nbins = 9
19101910
else:
1911-
nbins = None
1911+
nbins = 'auto'
19121912
MaxNLocator.__init__(self, nbins=nbins, steps=[1, 2, 5, 10])
19131913

19141914

0 commit comments

Comments
 (0)