Title: [Bug]: Colorbar is displaced when saving as .eps with bbox_inches='tight' · Issue #25176 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Colorbar is displaced when saving as .eps with bbox_inches='tight' · Issue #25176 · matplotlib/matplotlib
X Title: [Bug]: Colorbar is displaced when saving as .eps with bbox_inches='tight' · Issue #25176 · matplotlib/matplotlib
Description: Bug summary I am plotting with imshow() and create a colorbar. When saving the figure as .eps with savefig() and option bbox_inches='tight', the colorbar (without the spines) is displaced. Code for reproduction import matplotlib.pyplot a...
Open Graph Description: Bug summary I am plotting with imshow() and create a colorbar. When saving the figure as .eps with savefig() and option bbox_inches='tight', the colorbar (without the spines) is displaced. Code for...
X Description: Bug summary I am plotting with imshow() and create a colorbar. When saving the figure as .eps with savefig() and option bbox_inches='tight', the colorbar (without the spines) is displaced. ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/25176
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Colorbar is displaced when saving as .eps with bbox_inches='tight'","articleBody":"### Bug summary\r\nI am plotting with `imshow()` and create a colorbar. When saving the figure as .eps with `savefig()` and option `bbox_inches='tight'`, the colorbar (without the spines) is displaced.\r\n\r\n### Code for reproduction\r\n```python\r\nimport matplotlib.pyplot as plt\r\n\r\nfig = plt.figure()\r\nplt.imshow([[1, 1], [1, 1]])\r\nplt.colorbar()\r\nplt.savefig(\"test.eps\", bbox_inches='tight')\r\nplt.show()\r\n```\r\n\r\n### Expected outcome\r\nColorbar should be placed inside the spines as when using `plt.show()`. Also, saving as .png instead of .eps works correctly.\r\n\r\n### Actual outcome\r\n\r\n\r\n### Additional information\r\nThe bug does not happen when using Matplotlib version 5.2.3. \r\n\r\n### Operating system\r\nWindows 10\r\n\r\n### Matplotlib version\r\n3.6.3\r\n\r\n### Matplotlib backend\r\nmodule://backend_interagg\r\n\r\n### Python version\r\n3.11.0","author":{"url":"https://github.com/Thomassien","@type":"Person","name":"Thomassien"},"datePublished":"2023-02-08T20:22:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/25176/matplotlib/issues/25176"}
| 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:f5a0268b-1532-ec5c-6639-51919f518f7e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95AE:30055C:1FA6E4:2B9CD0:6A51334A |
| html-safe-nonce | 7b8b81bbc6430e4c100620bc13fc6c5b3349027b8994f99f8ff87ab799366de4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUFFOjMwMDU1QzoxRkE2RTQ6MkI5Q0QwOjZBNTEzMzRBIiwidmlzaXRvcl9pZCI6IjMzNDk0MjE0ODE1NDEwNTUzMDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 499864c0cdb9a83f90a3d7ee9ac70b68ecdd04c67246ea761a01a9b56ec5cd5d |
| hovercard-subject-tag | issue:1576752337 |
| 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/25176/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a1648f49a4fcd791c990bfcb6845de144638bf732dfa03c17df9b48c7ba6449c/matplotlib/matplotlib/issues/25176 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a1648f49a4fcd791c990bfcb6845de144638bf732dfa03c17df9b48c7ba6449c/matplotlib/matplotlib/issues/25176 |
| og:image:alt | Bug summary I am plotting with imshow() and create a colorbar. When saving the figure as .eps with savefig() and option bbox_inches='tight', the colorbar (without the spines) is displaced. Code for... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Thomassien |
| hostname | github.com |
| expected-hostname | github.com |
| None | e840f405b2718e8f2d55aafa9ff27dbce17e29d0c253011d05ea0fea3c78baff |
| 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 | 4ae6027e8ba70c79dc08249bb6cdc1a09d788496 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width