-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Savefig's frameon is ignored #10939
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
Comments
#10023 does not address the |
It doesn't, but the general idea there is that I'd like to move as many of these kwargs as possible out of savefig, and just have the user manipulate whatever figure/axes properties they want, as needed. |
This was referenced Jul 23, 2018
This was deprecated in the above PR and subsequently removed in #16165. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
savefig
documentation says about theframeon
argumentThis does not seem to be the case
gives (grey is the background to see the effect):
We would expect to see a difference if
frameon=False
, namely to not have the white frame present in the plot.The only option to get the frame off is apparently to use a transparent color for the
facecolor
argumentThis however still keeps the background patch. It is hence what we would expect the
transparent
argument insavefig
to do.So this has essentially the effect one would expect from
frameon
, except that it applies to the figure patch and the axes patches.It also is overwritten in case a
facecolor
is specified.While this is according to the documentation, it's highly confusing.
Here is a jupyter notebook in case people want to reproduce all the figures: TransparencyIssue.zip
To summarize:
frameon
is ignored.transparent
is conditional on thefacecolor
being set. (This leads to very counterintuitive behaviour, e.g.savefig(..., transparent=True, facecolor=None)
results in a non-transparent background with a transparent axes.Proposal for a fix:
frameon
keeps or removes the background patch.transparent
turns the background patch and all axes transparent, independently of the facecolor.facecolor
with a transparent color like(1,1,1,0)
can be used in the rather uncommon case where a transparent background patch is needed (and henceframeon=False
would not help) but the axes should not be made transparent.transparent=True
remove a colorbar patch's facecolor [*]The text was updated successfully, but these errors were encountered: