{{ message }}
Don't set savefig.facecolor/edgecolor in dark_background/538 styles. - #28156
Merged
Merged
Conversation
tacaswell
approved these changes
Apr 30, 2024
timhoffm
approved these changes
Apr 30, 2024
Member
Member
|
This is a hold over from the 1.x days when the figure face color was gray and we had a second face color (which defaulted to |
QuLogic
reviewed
May 1, 2024
| @@ -0,0 +1,12 @@ | |||
| dark_background and fivethirtyeight styles no longer set ``savefig.facecolor`` and ``savefig.edgecolor`` | |||
Member
There was a problem hiding this comment.
This filename is not updated with the PR number.
Previously, the dark_background and fivethirtyeight styles would set the
savefig.facecolor and savefig.edgecolor rcParams to the same values as
figure.facecolor and figure.edgecolor; i.e., if a user uses a style but
tweaks the figure facecolor, this tweak is lost (overridden) when saving
the figure. A concrete example would be using the dark_background style
but wanting a dark gray background instead of a black one, e.g.
`mpl.style.use(["dark_background", {"figure.facecolor": ".2"}]); plot();
savefig(...)`.
In all likelihood these values were set because the styles
predate the ability to set these savefig rcParams to "auto", which means
"don't change the figure facecolor, just use it as is" (a feature
introduced exactly because this auto-switching of color by savefig was
confusing users). Now we can just remove these rcParams from the two
styles (which are the only ones affected by the issue -- the grayscale
style also sets savefig.facecolor but to a value different from
figure.facecolor) and let them inherit the global default value, "auto".
Member
|
The appevyor failure looks sphinx related. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Previously, the dark_background and fivethirtyeight styles would set the savefig.facecolor and savefig.edgecolor rcParams to the same values as figure.facecolor and figure.edgecolor; i.e., if a user uses a style but tweaks the figure facecolor, this tweak is lost (overridden) when saving the figure. A concrete example would be using the dark_background style but wanting a dark gray background instead of a black one, e.g.
mpl.style.use(["dark_background", {"figure.facecolor": ".2"}]); plot(); savefig(...).In all likelihood these values were set because the styles predate the ability to set these savefig rcParams to "auto", which means "don't change the figure facecolor, just use it as is" (a feature introduced in #15111 exactly because this auto-switching of color by savefig was confusing users). Now we can just remove these rcParams from the two styles (which are the only ones affected by the issue -- the grayscale style also sets savefig.facecolor but to a value different from figure.facecolor) and let them inherit the global default value, "auto".
PR summary
PR checklist