-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Clean up legend loc parameter documentation #25325
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
Conversation
As we now have different docs for the *loc* parameter to `Figure/Axes.legend`, we can replace the ambiguous 'axes/figure' with the correct type. And also remove 'best' from the `Figure.legend` version. Note, I did not remove 'best' from the numerical table, as that would be annoying to do, so I just annotated it. Fixes #matplotlib#25323
The legend location can be specified by setting *loc* with a tuple of | ||
2 floats, which is interpreted as the lower-left corner of the legend | ||
in the normalized axes coordinate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already described in the loc
parameter docstring, so no need for it here.
Users can specify any arbitrary location for the legend using the | ||
*bbox_to_anchor* keyword argument. *bbox_to_anchor* can be a | ||
`.BboxBase` (or derived there from) or a tuple of 2 or 4 floats. | ||
See `set_bbox_to_anchor` for more detail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this is described in much more detail in the bbox_to_anchor
parameter docstring, so I didn't see a need to keep it either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, and the user comes to the parameter docstring before this.
Users can specify any arbitrary location for the legend using the | ||
*bbox_to_anchor* keyword argument. *bbox_to_anchor* can be a | ||
`.BboxBase` (or derived there from) or a tuple of 2 or 4 floats. | ||
See `set_bbox_to_anchor` for more detail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, and the user comes to the parameter docstring before this.
…325-on-v3.7.x Backport PR #25325 on branch v3.7.x (Clean up legend loc parameter documentation)
PR Summary
As we now have different docs for the loc parameter to
Figure/Axes.legend
, we can replace the ambiguous 'axes/figure' with the correct type. And also remove 'best' from theFigure.legend
version.Note, I did not remove 'best' from the numerical table, as that would be annoying to do, so I just annotated it.
Fixes #25323
PR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst