Skip to content

Dedupe some box anchoring code between legend.py and offsetbox.py.#20524

Merged
QuLogic merged 1 commit into
matplotlib:masterfrom
anntzer:lo
Jun 30, 2021
Merged

Dedupe some box anchoring code between legend.py and offsetbox.py.#20524
QuLogic merged 1 commit into
matplotlib:masterfrom
anntzer:lo

Conversation

@anntzer
Copy link
Copy Markdown
Contributor

@anntzer anntzer commented Jun 26, 2021

PR Summary

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

Copy link
Copy Markdown
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+/- optional changes.

On a more general note, it feels wrong that legend needs to explicitly handle locating. Shouldn't a legend be some subclass of an anchored box (I'm not very familiar with that part of the library, so I don't know which class exactly)?

Comment thread lib/matplotlib/offsetbox.py Outdated
Comment thread lib/matplotlib/offsetbox.py Outdated
@anntzer
Copy link
Copy Markdown
Contributor Author

anntzer commented Jun 28, 2021

It's probably possible to make legend reuse more of the offsetbox code, but there'd need to be quite a bit of backcompat/surgery due to different attribute names, etc. so that'd be a separate project.

@QuLogic
Copy link
Copy Markdown
Member

QuLogic commented Jun 29, 2021

Did you not push the optional changes?

@anntzer
Copy link
Copy Markdown
Contributor Author

anntzer commented Jun 29, 2021

oopsie.

@QuLogic QuLogic merged commit 108e1b0 into matplotlib:master Jun 30, 2021
@QuLogic QuLogic added this to the v3.5.0 milestone Jun 30, 2021
@anntzer anntzer deleted the lo branch June 30, 2021 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants