Title: [Bug]: PaddedBox not working · Issue #24620 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: PaddedBox not working · Issue #24620 · matplotlib/matplotlib
X Title: [Bug]: PaddedBox not working · Issue #24620 · matplotlib/matplotlib
Description: Bug summary PaddedBox https://matplotlib.org/stable/api/offsetbox_api.html#matplotlib.offsetbox.PaddedBox doesn't look like it is working properly. Code for reproduction import matplotlib.pyplot as plt from matplotlib.offsetbox import Pa...
Open Graph Description: Bug summary PaddedBox https://matplotlib.org/stable/api/offsetbox_api.html#matplotlib.offsetbox.PaddedBox doesn't look like it is working properly. Code for reproduction import matplotlib.pyplot as...
X Description: Bug summary PaddedBox https://matplotlib.org/stable/api/offsetbox_api.html#matplotlib.offsetbox.PaddedBox doesn't look like it is working properly. Code for reproduction import matplotlib.pyplo...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/24620
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: PaddedBox not working","articleBody":"### Bug summary\r\n \r\n`PaddedBox` https://matplotlib.org/stable/api/offsetbox_api.html#matplotlib.offsetbox.PaddedBox doesn't look like it is working properly.\r\n\r\n### Code for reproduction\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nfrom matplotlib.offsetbox import PaddedBox, AnchoredText\r\n\r\nfig, ax = plt.subplots()\r\n\r\nat = AnchoredText(\"foo\", 'upper left')\r\npb = PaddedBox(at, pad=1, patch_attrs={'facecolor' : 'r'}, draw_frame=True)\r\n\r\nax.add_artist(pb)\r\nfig.show()\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\n\r\n\r\n\r\n### Expected outcome\r\n\r\nRed box is at same location as text.\r\n\r\n### Additional information\r\n\r\nIt seems like the sizing is working OK (using a longer string will change the size accordingly), but that the positioning is not working.\r\n\r\nAlso, not passing `pad` leads to an error, so it should probably be 0. as default rather than `None`.\r\n\r\n### Operating system\r\n\r\n_No response_\r\n\r\n### Matplotlib Version\r\n\r\n`main`\r\n\r\n### Matplotlib Backend\r\n\r\n_No response_\r\n\r\n### Python version\r\n\r\n_No response_\r\n\r\n### Jupyter version\r\n\r\n_No response_\r\n\r\n### Installation\r\n\r\ngit checkout","author":{"url":"https://github.com/oscargus","@type":"Person","name":"oscargus"},"datePublished":"2022-12-04T18:37:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/24620/matplotlib/issues/24620"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:32bb46a5-4995-e84d-7640-dab0c278b747 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CCD2:2A1FE2:316AF2:422819:6A52EB0F |
| html-safe-nonce | 0379a4fbd2506a6589961b26b619c9718c09d3785ae8d1876d5012d41da199bf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQ0QyOjJBMUZFMjozMTZBRjI6NDIyODE5OjZBNTJFQjBGIiwidmlzaXRvcl9pZCI6IjM0NjI1NjEzMzExMTg1MzMzOTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0c3555c96a671e855ff78b6f2c8d4fd096896a7fc8a6b34b64495786349c0ab0 |
| hovercard-subject-tag | issue:1475071846 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/matplotlib/matplotlib/24620/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5aa3c8260069a9bfe0643893e6972fb0f05f99a475baa426ef93e92ffb17c9bf/matplotlib/matplotlib/issues/24620 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5aa3c8260069a9bfe0643893e6972fb0f05f99a475baa426ef93e92ffb17c9bf/matplotlib/matplotlib/issues/24620 |
| og:image:alt | Bug summary PaddedBox https://matplotlib.org/stable/api/offsetbox_api.html#matplotlib.offsetbox.PaddedBox doesn't look like it is working properly. Code for reproduction import matplotlib.pyplot as... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | oscargus |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | false |
| 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