Title: Improve RectangleSelector rotation by dstansby · Pull Request #21945 · matplotlib/matplotlib · GitHub
Open Graph Title: Improve RectangleSelector rotation by dstansby · Pull Request #21945 · matplotlib/matplotlib
X Title: Improve RectangleSelector rotation by dstansby · Pull Request #21945 · matplotlib/matplotlib
Description: PR Summary This modifies RectangleSelector and EllipseSelector to be drawn in display coordinates instead of display coordinates. This has a number of advantages: Allows the rectangle to be rotated past the previous +/- 45 degrees limit Fixes scaling the rectangle when it is rotated (to demonstrate, create a selector with rotation and try scaling before and then with this PR). Removes the need for _aspect_ratio_correction. Improves performance, because the event handling and artist drawing is all done in figure coordinates, removing transformations to data coordinates and back. Code to test: import matplotlib.pyplot as plt from matplotlib.widgets import RectangleSelector fig = plt.figure() ax = fig.add_subplot() selector = RectangleSelector(ax, lambda *args: None, interactive=True) selector.extents = (0.4, 0.7, 0.3, 0.4) selector.add_state('rotate') plt.show() Fixes #21937 PR Checklist Tests and Styling Has pytest style unit tests (and pytest passes). Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all). Documentation New features are documented, with examples if plot related. 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). Documentation is sphinx and numpydoc compliant (the docs should build without error).
Open Graph Description: PR Summary This modifies RectangleSelector and EllipseSelector to be drawn in display coordinates instead of display coordinates. This has a number of advantages: Allows the rectangle to be rotate...
X Description: PR Summary This modifies RectangleSelector and EllipseSelector to be drawn in display coordinates instead of display coordinates. This has a number of advantages: Allows the rectangle to be rotate...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/21945
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:8891bb59-ae56-ca2c-a99f-4682f6876dad |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BDD6:16F251:28078D:363BED:6A52E7BD |
| html-safe-nonce | e2411a7aadcc2cb5edee448bcf7e6565e3b8434bc7f0d70d30d71889b7605b67 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCREQ2OjE2RjI1MToyODA3OEQ6MzYzQkVEOjZBNTJFN0JEIiwidmlzaXRvcl9pZCI6IjEyNTYyNjY0NTExMjEyNjg2NjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5096564a92f88f6dc9a8982a5345bd6371668a35e194b23857bacd6b44f162c8 |
| hovercard-subject-tag | pull_request:802278777 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/21945/files |
| twitter:image | https://avatars.githubusercontent.com/u/6197628?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/6197628?s=400&v=4 |
| og:image:alt | PR Summary This modifies RectangleSelector and EllipseSelector to be drawn in display coordinates instead of display coordinates. This has a number of advantages: Allows the rectangle to be rotate... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width