New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make background transparent by default when saving figure #2384
Comments
By this, do you mean an interactive backend? |
Exactly. I adapted the original post. |
I think this overlaps with Issue #2388 |
I'm not in favour of changing default behaviour, especially in this case. If a transparent background is made the default, figures will look different in different viewers. However, it looks like @tacaswell has put together a patch to allow one to change the default behaviour by setting a parameter in matplotlib's configuration file. I'd be happy with that. I'm going to head over there and give his patch a review. Thanks for the input @nschloe. |
Workaround implemented in #2390. |
I would argue that the idea of having a figure blending in with the background in which it is embedded (e.g., a color gradient in a presentation) outweighs a consistent background of the figure when embedded in multiple documents, so I'd still vote for a transparent default. Anyways, thanks for the quick reaction here! |
I would argue that a color gradient in a presentation is exactly the time you want to have a uniform solid background (so you can actually read the plot). Changing defaults at all is bad (because you break working code and is as such a non-backwards compatible API change) and I find this one a particularly bad idea. You can now make your code behave this way just by adding |
When saving a matplotlib figure as PNG or SVG, the background is always saved as white canvas. This is somewhat confusing since the background color of a figure as displayed by matplotlib's interactive backend is gray.
Also, the white background makes the figure look foreign when embedded in something that does not have a white background.
I would suggest to change the default either to save the background
Note that the letter is possible by explicitly setting
The text was updated successfully, but these errors were encountered: