Title: [Bug]: Backgroundcolor of text is set in a too wide range · Issue #29874 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Backgroundcolor of text is set in a too wide range · Issue #29874 · matplotlib/matplotlib
X Title: [Bug]: Backgroundcolor of text is set in a too wide range · Issue #29874 · matplotlib/matplotlib
Description: Bug summary Backgroundcolor of text is set in a too wide range when setting it for the first time. Problem: Border of first color remains when backgroundcolor is set again. Code for reproduction ''' Backgroundcolor of text is set in a to...
Open Graph Description: Bug summary Backgroundcolor of text is set in a too wide range when setting it for the first time. Problem: Border of first color remains when backgroundcolor is set again. Code for reproduction ''...
X Description: Bug summary Backgroundcolor of text is set in a too wide range when setting it for the first time. Problem: Border of first color remains when backgroundcolor is set again. Code for reproduction ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29874
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Backgroundcolor of text is set in a too wide range","articleBody":"### Bug summary\n\nBackgroundcolor of text is set in a too wide range when setting it for the first time.\nProblem: Border of first color remains when backgroundcolor is set again.\n\n\n\n\n### Code for reproduction\n\n```Python\n''' Backgroundcolor of text is set in a too wide range when setting it for the first time.\n Problem: Border of first color remains when backgroundcolor is set again.'''\n\n# windows 11\n# Python version 3.13.2\n# Matplotlib version 3.10.1\n\nimport matplotlib.pyplot as plt\n\nfig, ax = plt.subplots(1, 1)\nfig.set_dpi(100)\n\ntxt = ax.text(0.1, 0.8, 'There should not be a red border around this text !')\n\n##txt.set(backgroundcolor='none') # Uncomment this line as workaround to avoid red border\ntxt.set(backgroundcolor='red') # Set backgroundcolor for the first time\ntxt.set(backgroundcolor='none') # Cannot reset backgroundcolor of text completely, red border remains\n\nplt.show()\n```\n\n### Actual outcome\n\nText with red border, see picture above.\n\n### Expected outcome\n\nText without red border.\n\n### Additional information\n\nThere is a workaround for the first, but not a fix, see Python program above.\n\n### Operating system\n\nWindows\n\n### Matplotlib Version\n\n3.10.1\n\n### Matplotlib Backend\n\ntkagg\n\n### Python version\n\n3.13.2\n\n### Jupyter version\n\n-\n\n### Installation\n\npip","author":{"url":"https://github.com/siegbert7","@type":"Person","name":"siegbert7"},"datePublished":"2025-04-06T08:27:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/29874/matplotlib/issues/29874"}
| 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:436f5d4f-9296-68f3-9f50-4a09242fbc51 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D6BE:E28FC:FA9B01:14D50E1:6A51C537 |
| html-safe-nonce | 9a06b542cd3dce245fcfa9ce6f0fc4916c961fc638f728b785bcce30370ff7ed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkJFOkUyOEZDOkZBOUIwMToxNEQ1MEUxOjZBNTFDNTM3IiwidmlzaXRvcl9pZCI6IjQzNDE5NjIyODAxODA3NjE5MTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7ecccdffdf1364b6fe66686fe37f9418006974de73dca0f45ec9ecc0ab5d7abc |
| hovercard-subject-tag | issue:2974795423 |
| 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/29874/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1a6851cadb5bb7e751652e0844ce2116eadc121d8c270a1a9988ee9e3f85df1d/matplotlib/matplotlib/issues/29874 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1a6851cadb5bb7e751652e0844ce2116eadc121d8c270a1a9988ee9e3f85df1d/matplotlib/matplotlib/issues/29874 |
| og:image:alt | Bug summary Backgroundcolor of text is set in a too wide range when setting it for the first time. Problem: Border of first color remains when backgroundcolor is set again. Code for reproduction ''... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | siegbert7 |
| 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