Title: [Bug]: bbox computed incorrectly when using a superscript · Issue #21653 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: bbox computed incorrectly when using a superscript · Issue #21653 · matplotlib/matplotlib
X Title: [Bug]: bbox computed incorrectly when using a superscript · Issue #21653 · matplotlib/matplotlib
Description: Bug summary When including LaTeX with a superscript, the bbox is computed incorrectly. Code for reproduction import matplotlib.pyplot as plt kw = dict( usetex=True, fontsize=40, bbox=dict(boxstyle='round,pad=0', fc='lightsteelblue', ec='...
Open Graph Description: Bug summary When including LaTeX with a superscript, the bbox is computed incorrectly. Code for reproduction import matplotlib.pyplot as plt kw = dict( usetex=True, fontsize=40, bbox=dict(boxstyle=...
X Description: Bug summary When including LaTeX with a superscript, the bbox is computed incorrectly. Code for reproduction import matplotlib.pyplot as plt kw = dict( usetex=True, fontsize=40, bbox=dict(boxstyle=...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/21653
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: bbox computed incorrectly when using a superscript","articleBody":"### Bug summary\n\nWhen including LaTeX with a superscript, the bbox is computed incorrectly.\n\n### Code for reproduction\n\n```python\nimport matplotlib.pyplot as plt\r\n\r\nkw = dict(\r\n usetex=True,\r\n fontsize=40,\r\n bbox=dict(boxstyle='round,pad=0', fc='lightsteelblue', ec='none')\r\n)\r\n\r\nplt.axhline(y=0.7)\r\nplt.annotate('A', xy=(0.3, 0.7), **kw)\r\nplt.annotate(r'$A$', xy=(0.4, 0.7), **kw)\r\nplt.annotate(r'$^{\\tiny 1}A$', xy=(0.5, 0.7), **kw)\r\nplt.annotate(r'$^{\\tiny 1j}A$', xy=(0.65, 0.7), **kw)\r\n\r\nplt.axhline(y=0.4)\r\nplt.annotate('A', xy=(0.3, 0.4), va='bottom', **kw)\r\nplt.annotate(r'$A$', xy=(0.4, 0.4), va='bottom', **kw)\r\nplt.annotate(r'$^{1}A$', xy=(0.5, 0.4), va='bottom', **kw)\r\nplt.annotate(r'$^{1j}A$', xy=(0.65, 0.4), va='bottom', **kw)\r\n\r\nplt.show()\n```\n\n\n### Actual outcome\n\n\r\n\n\n### Expected outcome\n\nThe bounding box should correctly surround the superscript.\n\n### Additional information\n\nRelated bugs: #7075 #14177\n\n### Operating system\n\nUbuntu\n\n### Matplotlib Version\n\n3.5.0\n\n### Matplotlib Backend\n\n_No response_\n\n### Python version\n\n3.8.10\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\npip","author":{"url":"https://github.com/kc9jud","@type":"Person","name":"kc9jud"},"datePublished":"2021-11-16T18:50:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/21653/matplotlib/issues/21653"}
| 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:b1f8295f-5bd0-787b-dcad-f8c88942822b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D29C:16A191:120F4BF:18906C4:6A5216E4 |
| html-safe-nonce | 5397788ec6c692c611d1f181c4fbd8f346dc74318ee0971daf76e7ef3a292326 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjlDOjE2QTE5MToxMjBGNEJGOjE4OTA2QzQ6NkE1MjE2RTQiLCJ2aXNpdG9yX2lkIjoiMjE0NTM5MzI3MjAyMDkzMjMyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9e48cb44909284630f2ea2899d2b5a7ce42690ad0de61e9aaf0c7d1f1f1f2b86 |
| hovercard-subject-tag | issue:1055211764 |
| 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/21653/issue_layout |
| twitter:image | https://opengraph.githubassets.com/31192fbbb7493bf6b285778d73f533bb7f139b52d6df4032698652b747028c89/matplotlib/matplotlib/issues/21653 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/31192fbbb7493bf6b285778d73f533bb7f139b52d6df4032698652b747028c89/matplotlib/matplotlib/issues/21653 |
| og:image:alt | Bug summary When including LaTeX with a superscript, the bbox is computed incorrectly. Code for reproduction import matplotlib.pyplot as plt kw = dict( usetex=True, fontsize=40, bbox=dict(boxstyle=... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kc9jud |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width