Title: Changed axis selection when zooming datalim-adjustable fixed-aspect axes by anntzer · Pull Request #14899 · matplotlib/matplotlib · GitHub
Open Graph Title: Changed axis selection when zooming datalim-adjustable fixed-aspect axes by anntzer · Pull Request #14899 · matplotlib/matplotlib
X Title: Changed axis selection when zooming datalim-adjustable fixed-aspect axes by anntzer · Pull Request #14899 · matplotlib/matplotlib
Description: x_trf goes from rawdata-space to scaled-space, so it's what should get applied to datalims, not x_trf.inverted(). So x0, x1 = map(x_trf.inverted().transform, dL.intervalx) y0, y1 = map(y_trf.inverted().transform, dL.intervaly) from 87c742b should have been x0, x1 = map(x_trf.transform, dL.intervalx) y0, y1 = map(y_trf.transform, dL.intervaly) Edit: This is getting fixed in #14990, what remains is possibly a revisit of the choice of axis to resize, described below. However, fixing that triggered a failure for test_aspect_nonlinear_adjustable_datalim which had been added in that commit, and fixing that unraveled more issues. The basic question is, when aspect is set and adjustable="datalim", should we change the x limits or the y limits to get the correct aspect? The old code used some complex conditions, which I actually haven't managed to fully understand, to either expand or shrink one of the axises. Instead, just choose to always expand (rather than shrink) one of the axises, which will avoid sending artists out-of-bounds. (The sole exception is in care of shared axes, which we do not touch as explained in the comment.) This patch caused a change in the autolimiting of test_axes.py::test_pie_frame_grid which was buggy anyways, I forced the old behavior by setting x/ylims manually (after checking that the default is to expand the limits). Closes #14898. PR Summary PR Checklist Has Pytest style unit tests Code is Flake 8 compliant New features are documented, with examples if plot related Documentation is sphinx and numpydoc compliant Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there) Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way
Open Graph Description: x_trf goes from rawdata-space to scaled-space, so it's what should get applied to datalims, not x_trf.inverted(). So x0, x1 = map(x_trf.inverted().transform, dL.intervalx) y0, ...
X Description: x_trf goes from rawdata-space to scaled-space, so it's what should get applied to datalims, not x_trf.inverted(). So x0, x1 = map(x_trf.inverted().transform, dL.intervalx) ...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/14899
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:93b788d6-43cd-12ca-e9cc-e1c179eb08e6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 91BC:141053:44E20:5ABA0:6A52D39A |
| html-safe-nonce | 94a9dff9d45371cd284882364360ab5934989fff2f6dd4ea051493dd99980131 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MUJDOjE0MTA1Mzo0NEUyMDo1QUJBMDo2QTUyRDM5QSIsInZpc2l0b3JfaWQiOiIzNDY5NTA1NzM0ODkwNDEwOTA3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f6f9c6f3338a7557d96141051f4570262813d26111b4bd2e98ae4dc6d5a463b9 |
| hovercard-subject-tag | pull_request:301755238 |
| 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/14899/files |
| twitter:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| og:image:alt | x_trf goes from rawdata-space to scaled-space, so it's what should get applied to datalims, not x_trf.inverted(). So x0, x1 = map(x_trf.inverted().transform, dL.intervalx) y0, ... |
| 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