Title: [Bug]: Annotation clip path / box regression in 3.9 · Issue #28717 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Annotation clip path / box regression in 3.9 · Issue #28717 · matplotlib/matplotlib
X Title: [Bug]: Annotation clip path / box regression in 3.9 · Issue #28717 · matplotlib/matplotlib
Description: Bug summary In matplotlib 3.9.1, the clip_path and clip_bbox arguments of annotate do not properly clip the annotation. The code example below worked as expected in 3.8. Code for reproduction import matplotlib import matplotlib.pyplot as...
Open Graph Description: Bug summary In matplotlib 3.9.1, the clip_path and clip_bbox arguments of annotate do not properly clip the annotation. The code example below worked as expected in 3.8. Code for reproduction impor...
X Description: Bug summary In matplotlib 3.9.1, the clip_path and clip_bbox arguments of annotate do not properly clip the annotation. The code example below worked as expected in 3.8. Code for reproduction impor...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/28717
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Annotation clip path / box regression in 3.9","articleBody":"### Bug summary\n\nIn matplotlib 3.9.1, the `clip_path` and `clip_bbox` arguments of `annotate` do not properly clip the annotation.\r\n\r\nThe code example below worked as expected in 3.8.\n\n### Code for reproduction\n\n```Python\nimport matplotlib\r\nimport matplotlib.pyplot as plt\r\nfrom matplotlib.transforms import Bbox, TransformedBbox\r\n\r\nfig, ax = plt.subplots()\r\n\r\nrect = ax.axvspan(0.5, 0.55, 0, 1)\r\n\r\ntransform = ax.get_xaxis_transform()\r\n\r\nbbox = Bbox.from_extents(0.5, 0, 0.55, 1)\r\ntbbox = TransformedBbox(bbox, transform)\r\n\r\ntext_kw= dict()\r\ntext_kw.setdefault(\"va\", \"top\")\r\ntext_kw.setdefault(\"clip_on\", True)\r\ntext_kw.setdefault(\"bbox\", dict(boxstyle=\"round\", facecolor=\"white\"))\r\n\r\n\r\nann = ax.annotate(\r\n \"Annotation\",\r\n xy=(0.5, 1),\r\n xytext=(8, -10),\r\n textcoords=\"offset points\",\r\n clip_path=rect,\r\n clip_box=tbbox,\r\n **text_kw,\r\n)\r\n\r\nax.set(xlim=[0, 1])\n```\n\n\n### Actual outcome\n\n\r\n\r\nIn matplotlib 3.9.1. Note that the annotation is not clipped.\n\n### Expected outcome\n\n\r\n\r\nGenerated with matplotlib 3.8.1; the annotation is properly clipped.\n\n### Additional information\n\n_No response_\n\n### Operating system\n\nn/a\n\n### Matplotlib Version\n\n3.9.1\n\n### Matplotlib Backend\n\n'module://matplotlib_inline.backend_inline'\n\n### Python version\n\nmany (3.8 to 3.12)\n\n### Jupyter version\n\nn/a\n\n### Installation\n\nconda","author":{"url":"https://github.com/bmcfee","@type":"Person","name":"bmcfee"},"datePublished":"2024-08-13T14:51:45Z","url":"https://github.com/matplotlib/matplotlib/issues/28717"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f47046c8-e395-d8c5-a559-34d54b9c12e1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A438:11BA80:13FE63:1B6117:6B0675D2 |
| html-safe-nonce | 75f282bb88e1e0045595661b6bf8c383ddbb994a6b74fb41b761b9f76996df97 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDM4OjExQkE4MDoxM0ZFNjM6MUI2MTE3OjZCMDY3NUQyIiwidmlzaXRvcl9pZCI6IjE1OTc1NDM5MjU0MDc5NzA3NzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8122cef53eeba3decb5dc5b48c8b3850eb2d4d3f41b10c7ad67e3928a856899e |
| hovercard-subject-tag | issue:2463554842 |
| 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/28717/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a76e2a86bd8b41f38b0fc1a11bb980b3fd8360df5a0426353b184b3d1f347ea6/matplotlib/matplotlib/issues/28717 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a76e2a86bd8b41f38b0fc1a11bb980b3fd8360df5a0426353b184b3d1f347ea6/matplotlib/matplotlib/issues/28717 |
| og:image:alt | Bug summary In matplotlib 3.9.1, the clip_path and clip_bbox arguments of annotate do not properly clip the annotation. The code example below worked as expected in 3.8. Code for reproduction impor... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bmcfee |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4462ff7ebfd3d551f202659f2423dae617b6849d23b1df6465dc504ef497d14a |
| 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 | 6d3909414814ff86ce7da4c51a0f4918a13fb41b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width