Title: correctly treat pan/zoom events of overlapping axes by raphaelquast · Pull Request #22347 · matplotlib/matplotlib · GitHub
Open Graph Title: correctly treat pan/zoom events of overlapping axes by raphaelquast · Pull Request #22347 · matplotlib/matplotlib
X Title: correctly treat pan/zoom events of overlapping axes by raphaelquast · Pull Request #22347 · matplotlib/matplotlib
Description: PR Summary This is intended to fix the treatment of pan/zoom events for overlapping axes (e.g. #22324 ) 🐍 code to generate the plot of the gif import matplotlib.pyplot as plt def styleax(ax, bg, c, zorder, txtxy=(.5,.5)): # bg=False sets the patch to invisible # any other value keeps the patch AS IS if bg is False: ax.patch.set_visible(False) for _, s in ax.spines.items(): s.set_edgecolor(c) ax.tick_params(axis='x', colors=c) ax.tick_params(axis='y', colors=c) else: ax.patch.set_facecolor(c) for _, s in ax.spines.items(): s.set_edgecolor(c) ax.tick_params(axis='x', colors=c) ax.tick_params(axis='y', colors=c) ax.set_zorder(zorder) if txtxy: ax.text(*txtxy, f"{'NO' if bg is False else ''} patch axes \n at zorder={zorder}", c=c, horizontalalignment="center", verticalalignment="center", bbox=dict(facecolor='w', alpha=0.75), fontsize=7) f, ax = plt.subplots() styleax(ax, None, ".8", 0, False) styleax(ax.twinx(), None, ".8", 0, False) # a basic twinx # manually added axes with background ax = f.add_axes((.5,.5,.4,.4)) styleax(ax, None, "g", 0, (.7, .5)) # manually added axes with background and twinx ax = f.add_axes((.5,.5,.2,.2)) styleax(ax, None, "b", 0) styleax(ax.twinx(), None, "b", 0, False) # manually added axes with NO background and twinx ax = f.add_axes((.2,.25,.2,.2)) styleax(ax, False, "r", 0) styleax(ax.twinx(), None, "r", 0, False) # manually added axes with NO background on different zorder ax = f.add_axes((0.05,.1,.55,.7)) styleax(ax, False, "c", 2, (.5,.7)) styleax(ax.twinx(), False, "c", 2, (.5,.7)) # manually added axes with background and twinx on different zorder ax = f.add_axes((.5,.25,.2,.2)) styleax(ax, None, "m", 5) styleax(ax.twinx(), None, "m", 5, False) # a joined axes ax2 = f.add_axes((.8,.25,.15,.15)) styleax(ax2, None, "m", 5) ax2.sharex(ax) changes on pan/zoom events instead of triggering all axes, only the topmost ax with ax.patch.get_visible = True triggers pan/zoom events axes with ax.patch.get_visible = False pass events to axes below (e.g. at lower or equal zorder) other changes to allow a coherent treatment for twin-axes, the zorder property is set to the zorder of the parent axes. in ax._make_twin_axes() 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 is intended to fix the treatment of pan/zoom events for overlapping axes (e.g. #22324 ) 🐍 code to generate the plot of the gif import matplotlib.pyplot as plt def styleax(ax, b...
X Description: PR Summary This is intended to fix the treatment of pan/zoom events for overlapping axes (e.g. #22324 ) 🐍 code to generate the plot of the gif import matplotlib.pyplot as plt def styleax(ax, b...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/22347
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0f71572f-7228-6c43-14e3-957da3d57c95 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 92E6:C35D8:12A25E5:18E0D82:6B066029 |
| html-safe-nonce | 54d5563e4083db416c91db44328a8996c79b5d853efa033829c364d8ab41410d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MkU2OkMzNUQ4OjEyQTI1RTU6MThFMEQ4Mjo2QjA2NjAyOSIsInZpc2l0b3JfaWQiOiIyMDQzNzIzMDIwOTUwMjAwMzYxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ab3b1c4be675e7206b19c2ddf9d75b32b03a5318effad7a0fa2ac6678e8f9ac5 |
| hovercard-subject-tag | pull_request:834644784 |
| 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/22347/files |
| twitter:image | https://avatars.githubusercontent.com/u/22773387?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/22773387?s=400&v=4 |
| og:image:alt | PR Summary This is intended to fix the treatment of pan/zoom events for overlapping axes (e.g. #22324 ) 🐍 code to generate the plot of the gif import matplotlib.pyplot as plt def styleax(ax, b... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6324e6ac990fb6befbec840cc0e102a1071c339bfe8f9826bb12de2e3ba1d297 |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7f0aa75f4141d440c6110dc31af7ea7797abb6c4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width