Skip to content

Commit 921daae

Browse files
committed
BUG : makes Axes.margins work with just kwargs
applied fix supplied by @syoung-m4 in #2510
1 parent f4ec1ef commit 921daae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/axes.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1832,11 +1832,13 @@ def margins(self, *args, **kw):
18321832
tight = kw.pop('tight', True)
18331833
mx = kw.pop('x', None)
18341834
my = kw.pop('y', None)
1835+
if len(kw) > 0:
1836+
raise ValueError("Too many kwargs provided")
18351837
if len(args) == 1:
18361838
mx = my = args[0]
18371839
elif len(args) == 2:
18381840
mx, my = args
1839-
else:
1841+
elif len(args) > 2:
18401842
raise ValueError("more than two arguments were supplied")
18411843
if mx is not None:
18421844
self.set_xmargin(mx)

0 commit comments

Comments
 (0)