8000 Backport PR #16585 on branch v3.2.x (Fix _preprocess_data for Py3.9.) by meeseeksmachine · Pull Request #16611 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Backport PR #16585 on branch v3.2.x (Fix _preprocess_data for Py3.9.) #16611

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
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
17 changes: 5 additions & 12 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1561,24 +1561,17 @@ def inner(ax, *args, data=None, **kwargs):
if replace_names is None or k in replace_names:
bound.arguments[k] = _replacer(data, v)

bound.apply_defaults()
del bound.arguments["data"]
new_args = bound.args
new_kwargs = bound.kwargs

if needs_label:
all_kwargs = {**bound.arguments, **bound.kwargs}
# label_namer will be in all_kwargs as we asserted above that
# `label_namer is None or label_namer in arg_names`.
label = _label_from_arg(all_kwargs[label_namer], auto_label)
if "label" in arg_names:
bound.arguments["label"] = label
try:
bound.arguments.move_to_end(varkwargs_name)
except KeyError:
pass
else:
bound.arguments.setdefault(varkwargs_name, {})["label"] = label
new_kwargs["label"] = _label_from_arg(
all_kwargs[label_namer], auto_label)

return func(*bound.args, **bound.kwargs)
return func(*new_args, **new_kwargs)

inner.__doc__ = _add_data_doc(inner.__doc__, replace_names)
inner.__signature__ = new_sig
Expand Down
0