8000 MaxNLocator: allow one non-keyword arg (nbins) · matplotlib/matplotlib@398e174 · GitHub
[go: up one dir, main page]

Skip to content

Commit 398e174

Browse files
committed
MaxNLocator: allow one non-keyword arg (nbins)
svn path=/trunk/matplotlib/; revision=8244
1 parent c1df6bf commit 398e174

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/ticker.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ class MaxNLocator(Locator):
10581058
integer=False,
10591059
symmetric=False,
10601060
prune=None)
1061-
def __init__(self, **kwargs):
1061+
def __init__(self, *args, **kwargs):
10621062
"""
10631063
Keyword args:
10641064
@@ -1090,6 +1090,11 @@ def __init__(self, **kwargs):
10901090
# I left "trim" out; it defaults to True, and it is not
10911091
# clear that there is any use case for False, so we may
10921092
# want to remove that kwarg. EF 2010/04/18
1093+
if args:
1094+
kwargs['nbins'] = args[0]
1095+
if len(args) > 1:
1096+
raise ValueError(
1097+
"Keywords are required for all arguments except 'nbins'")
10931098
self.set_params(**self.default_params)
10941099
self.set_params(**kwargs)
10951100

0 commit comments

Comments
 (0)
0