8000 Fix incorrect usage of nargs_error. by anntzer · Pull Request #25863 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix incorrect usage of nargs_error. #25863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def legend(self, *args, **kwargs):
*args,
**kwargs)
if len(extra_args):
_api.nargs_error('legend', '0-2', len(args))
raise _api.nargs_error('legend', '0-2', len(args))
self.legend_ = mlegend.Legend(self, handles, labels, **kwargs)
self.legend_._remove_method = self._remove_legend
return self.legend_
Expand Down Expand Up @@ -3005,7 +3005,7 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
which inspired this method.
"""
if not 1 <= len(args) <= 3:
_api.nargs_error('stem', '1-3', len(args))
raise _api.nargs_error('stem', '1-3', len(args))
_api.check_in_list(['horizontal', 'vertical'], orientation=orientation)

if len(args) == 1:
Expand Down Expand Up @@ -6422,7 +6422,7 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
else:
raise TypeError("arguments do not match valid signatures")
else:
_api.nargs_error('pcolorfast', '1 or 3', len(args))
raise _api.nargs_error('pcolorfast', '1 or 3', len(args))

if style == "quadmesh":
# data point in each cell is value at lower left corner
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ def cycler(*args, **kwargs):
elif len(args) == 2:
pairs = [(args[0], args[1])]
elif len(args) > 2:
_api.nargs_error('cycler', '0-2', len(args))
raise _api.nargs_error('cycler', '0-2', len(args))
else:
pairs = kwargs.items()

Expand Down
0