Title: BUG: Fix text appearing far outside valid axis scale range by scottshambaugh · Pull Request #31061 · matplotlib/matplotlib · GitHub
Open Graph Title: BUG: Fix text appearing far outside valid axis scale range by scottshambaugh · Pull Request #31061 · matplotlib/matplotlib
X Title: BUG: Fix text appearing far outside valid axis scale range by scottshambaugh · Pull Request #31061 · matplotlib/matplotlib
Description: PR summary Closes #31054 Text didn't have a get_tightbbox override yet, so this adds that with some handling for no-show cases. The _in_axes_domain check is not exclusive to text and may be useful elsewhere, so was given to Artist more broadly. The plot in the original issue renders correctly now, and I can confirm it was broken for me before: import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, 10, 100) y = np.sin(x) * 10 fig, ax = plt.subplots() ax.plot(x, y) ax.set_yscale('log') ax.text(5, -5, "I am at y = -5", color='red') plt.savefig("test_gh31054.png", bbox_inches='tight') PR checklist "closes #0000" is in the body of the PR description to link the related issue new and changed code is tested [n/a] Plotting related features are demonstrated in an example [n/a] New Features and API Changes are noted with a directive and release note [n/a] Documentation complies with general and docstring guidelines
Open Graph Description: PR summary Closes #31054 Text didn't have a get_tightbbox override yet, so this adds that with some handling for no-show cases. The _in_axes_domain check is not exclusive to text and may be use...
X Description: PR summary Closes #31054 Text didn't have a get_tightbbox override yet, so this adds that with some handling for no-show cases. The _in_axes_domain check is not exclusive to text and may be...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/31061
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:cf0ed3f0-a673-7f96-fb78-c92625e5a186 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BE5A:13DB1B:EB97EC:13CB4C1:6A51B849 |
| html-safe-nonce | 1f0cd180485a5ee8d18bbcbaa775535824b0086081d050e6ad9703f9684ddc44 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTVBOjEzREIxQjpFQjk3RUM6MTNDQjRDMTo2QTUxQjg0OSIsInZpc2l0b3JfaWQiOiI3NDkwMzA2MzMxODc1ODUwMzEzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1d35cd05034ff48f9127816b0cadfd9fec12d64c6b5c28c91ec6c096a16c3f86 |
| hovercard-subject-tag | pull_request:3238460718 |
| 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/31061/files |
| twitter:image | https://avatars.githubusercontent.com/u/14363975?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/14363975?s=400&v=4 |
| og:image:alt | PR summary Closes #31054 Text didn't have a get_tightbbox override yet, so this adds that with some handling for no-show cases. The _in_axes_domain check is not exclusive to text and may be use... |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width