Title: Saving a pdf, with a single image, grayscale colormap, and transparent background produces a black background · Issue #4260 · matplotlib/matplotlib · GitHub
Open Graph Title: Saving a pdf, with a single image, grayscale colormap, and transparent background produces a black background · Issue #4260 · matplotlib/matplotlib
X Title: Saving a pdf, with a single image, grayscale colormap, and transparent background produces a black background · Issue #4260 · matplotlib/matplotlib
Description: This issue appears to be similar to what eventually got resolved in #1894 If I save a pdf with a single image, grayscale colormap and a transparent background, the axes background does not remain transparent. It becomes a black backgroun...
Open Graph Description: This issue appears to be similar to what eventually got resolved in #1894 If I save a pdf with a single image, grayscale colormap and a transparent background, the axes background does not remain t...
X Description: This issue appears to be similar to what eventually got resolved in #1894 If I save a pdf with a single image, grayscale colormap and a transparent background, the axes background does not remain t...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/4260
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Saving a pdf, with a single image, grayscale colormap, and transparent background produces a black background","articleBody":"This issue appears to be similar to what eventually got resolved in https://github.com/matplotlib/matplotlib/pull/1894\n\nIf I save a pdf with a single image, grayscale colormap and a transparent background, the axes background does not remain transparent. It becomes a black background. If I deviate from any of those ingredients, then the background is transparent as specified.\n\nExample:\n\n```\nimport matplotlib.pyplot as plt\nfrom numpy.random import rand\n\nfig, ax = plt.subplots(nrows=3, ncols=1, sharex=True)\n\nax[0].imshow(rand(15,15), extent=[0, 2, 15, 0], \\\n cmap=plt.cm.gray, aspect='auto', interpolation='Nearest')\n\nax[1].imshow(rand(15,15), extent=[0, 2, 15, 0], \\\n cmap=plt.cm.rainbow, aspect='auto', interpolation='Nearest')\n\nax[2].imshow(rand(15,15), extent=[0, 2, 15, 0], \\\n cmap=plt.cm.gray, aspect='auto', interpolation='Nearest')\nax[2].imshow(rand(15,15), extent=[4, 6, 15, 0], \\\n cmap=plt.cm.gray, aspect='auto', interpolation='Nearest')\n\nax[-1].set_xlim([0, 8])\nfig.savefig('transparent.pdf', format='PDF', transparent = True)\nfig.savefig('opaque.pdf', format='PDF', transparent = False)\nfig.savefig('transparent.png', format='PNG', transparent = True)\n```\n\nHere is 'transparent.pdf', with the black background on the first set of axes:\n\n\nHere is 'opaque.pdf', which looks correct:\n\n\nHere is 'transparent.png', which also looks correct:\n\n\nIn case it matters, I am on Mac OS X 10.8.5, Enthought Canopy Python 2.7.6, and Matplotlib 1.4.0\n","author":{"url":"https://github.com/breedlun","@type":"Person","name":"breedlun"},"datePublished":"2015-03-22T16:28:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/4260/matplotlib/issues/4260"}
| 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:b88543c2-baa4-5413-1d3c-4fbdf674c087 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B686:A6E9E:3C215ED:52F7FF3:6A54C42D |
| html-safe-nonce | a3fc7e857c5523d59ee4875b2f745c3891c8737cca120794723da8ad34da474a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjg2OkE2RTlFOjNDMjE1RUQ6NTJGN0ZGMzo2QTU0QzQyRCIsInZpc2l0b3JfaWQiOiI1Nzg4NTIwNDkzOTczMDI5OTMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 547e6a56d888926187859309792a96f5aa041025c1b8c57f1b1b57b30b09c176 |
| hovercard-subject-tag | issue:63550210 |
| 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/4260/issue_layout |
| twitter:image | https://opengraph.githubassets.com/73e2d712448d7e458baa6bb2a594db9a6f7241e791f42c33bb216d3db1087604/matplotlib/matplotlib/issues/4260 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/73e2d712448d7e458baa6bb2a594db9a6f7241e791f42c33bb216d3db1087604/matplotlib/matplotlib/issues/4260 |
| og:image:alt | This issue appears to be similar to what eventually got resolved in #1894 If I save a pdf with a single image, grayscale colormap and a transparent background, the axes background does not remain t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | breedlun |
| 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 | 69f9664dd5e7a82ba8ab1b4cb7f5a2f09333ab38 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width