Title: [Bug]: Background of rotated png is rendered black · Issue #29300 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Background of rotated png is rendered black · Issue #29300 · matplotlib/matplotlib
X Title: [Bug]: Background of rotated png is rendered black · Issue #29300 · matplotlib/matplotlib
Description: Bug summary If I rotate an image, the background of its bounding box is rendered black when rendering as .pdf or .png Code for reproduction import matplotlib.pyplot as plt from matplotlib.transforms import Affine2D import numpy as np img...
Open Graph Description: Bug summary If I rotate an image, the background of its bounding box is rendered black when rendering as .pdf or .png Code for reproduction import matplotlib.pyplot as plt from matplotlib.transform...
X Description: Bug summary If I rotate an image, the background of its bounding box is rendered black when rendering as .pdf or .png Code for reproduction import matplotlib.pyplot as plt from matplotlib.transform...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29300
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Background of rotated png is rendered black","articleBody":"### Bug summary\n\nIf I rotate an image, the background of its bounding box is rendered black when rendering as .pdf or .png\n\n### Code for reproduction\n\n```Python\nimport matplotlib.pyplot as plt\nfrom matplotlib.transforms import Affine2D\nimport numpy as np\n\nimg = np.random.random((100, 20, 3))\n\ntr_rotate = Affine2D().rotate_deg_around(0 / 2, 0 / 2, 45)\ntr_translate = Affine2D().translate(250, 250)\n\nfig, ax = plt.subplots()\n\nax.imshow(\n img,\n transform=tr_rotate + ax.transData,\n clip_on=False,\n)\n\nax.imshow(\n img,\n transform=tr_translate + ax.transData,\n clip_on=False,\n)\n\nax.set_xlim(-250, 500)\nax.set_ylim(-250, 500)\n\nfig.savefig(\"MWE.png\")\n```\n\n\n### Actual outcome\n\n\n\n\n### Expected outcome\n\nTransparent Bounding Box\n\n### Additional information\n\nIn the past this was possible, however I don't know which version of matplotlib was used...\n\n### Operating system\n\nKDE Neon\n\n### Matplotlib Version\n\n3.9.2\n\n### Matplotlib Backend\n\ntkagg\n\n### Python version\n\n3.12.3\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\npip","author":{"url":"https://github.com/maederan201","@type":"Person","name":"maederan201"},"datePublished":"2024-12-13T06:41:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":15},"url":"https://github.com/29300/matplotlib/issues/29300"}
| 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:ff99296b-7d60-6591-bcf9-f31e2b4dc41a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD72:25F708:848069:B14DF1:6A52ABA9 |
| html-safe-nonce | fb3c124efc3531a0e59502fd32e380b9b6a33a11c601c6b281552fa89e108b1b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDcyOjI1RjcwODo4NDgwNjk6QjE0REYxOjZBNTJBQkE5IiwidmlzaXRvcl9pZCI6IjkxNTk2NjA3MzMxNjIyMzkxMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 230c204926e3476a542cb95bfee688e1abeea719cd3f85bf0439ce08d2f24f7a |
| hovercard-subject-tag | issue:2737557548 |
| 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/29300/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aa7448961470958ebb321621b42b044aaeed5f041cda4573c5db7dcc4b10eb2c/matplotlib/matplotlib/issues/29300 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aa7448961470958ebb321621b42b044aaeed5f041cda4573c5db7dcc4b10eb2c/matplotlib/matplotlib/issues/29300 |
| og:image:alt | Bug summary If I rotate an image, the background of its bounding box is rendered black when rendering as .pdf or .png Code for reproduction import matplotlib.pyplot as plt from matplotlib.transform... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | maederan201 |
| 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