Skip to content
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

Move _SelectorWidget._props into SpanSelector #25404

Merged
merged 2 commits into from Mar 11, 2023

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Mar 7, 2023

PR Summary

This is the only selector widget that needs to remember its properties separately from the artist, because the artist can be recreated.

Fixes #25199

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • [n/a] Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • [n/a] New plotting related features are documented with examples.

Release Notes

  • [n/a] New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • [n/a] API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • [n/a] Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

@anntzer
Copy link
Contributor

anntzer commented Mar 7, 2023

Instead of storing _props in a separate dict at all, can't the artist re-creation call Artist.update_from to copy the original artist's properties?

@QuLogic
Copy link
Member Author

QuLogic commented Mar 8, 2023

I just forgot about that; should work that way now.

lib/matplotlib/widgets.py Outdated Show resolved Hide resolved
This was the only selector widget that needed to remember its properties
separately from the artist, because the artist can be recreated, but we
can copy from the old to new.

Fixes matplotlib#25199
There are already a few for the other Selectors.
@greglucas greglucas merged commit 205e907 into matplotlib:main Mar 11, 2023
@QuLogic QuLogic deleted the selector-props branch March 13, 2023 21:51
@QuLogic QuLogic added this to the v3.8.0 milestone Mar 13, 2023
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.

[Bug]: AttributeError: 'LassoSelector' object has no attribute '_props'
3 participants