Skip to content

Re-rename builtin seaborn styles to not include a dot. #23674

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

Merged
merged 1 commit into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/api/next_api_changes/deprecations/22317-AL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ seaborn styles renamed
Matplotlib currently ships many style files inspired from the seaborn
library ("seaborn", "seaborn-bright", "seaborn-colorblind", etc.) but they
have gone out of sync with the library itself since the release of seaborn
0.9. To prevent confusion, the style files have been renamed "seaborn0.8",
"seaborn0.8-bright", "seaborn0.8-colorblind", etc. Users are encouraged to
0.9. To prevent confusion, the style files have been renamed "seaborn-v0_8",
"seaborn-v0_8-bright", "seaborn-v0_8-colorblind", etc. Users are encouraged to
directly use seaborn to access the up-to-date styles.
4 changes: 2 additions & 2 deletions lib/matplotlib/style/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ def fix_style(s):
"3.6", message="The seaborn styles shipped by Matplotlib "
"are deprecated since %(since)s, as they no longer "
"correspond to the styles shipped by seaborn. However, "
"they will remain available as 'seaborn0.8-<style>'. "
"they will remain available as 'seaborn-v0_8-<style>'. "
"Alternatively, directly use the seaborn API instead.")
s = s.replace("seaborn", "seaborn0.8")
s = s.replace("seaborn", "seaborn-v0_8")
return s

for style in map(fix_style, styles):
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def test_xkcd_cm():


def test_deprecated_seaborn_styles():
with mpl.style.context("seaborn0.8-bright"):
with mpl.style.context("seaborn-v0_8-bright"):
seaborn_bright = mpl.rcParams.copy()
assert mpl.rcParams != seaborn_bright
with pytest.warns(mpl._api.MatplotlibDeprecationWarning):
Expand Down
2 changes: 1 addition & 1 deletion tutorials/colors/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def demo(sty):


demo('default')
demo('seaborn0.8')
demo('seaborn-v0_8')

###############################################################################
# The first color ``'C0'`` is the title. Each plot uses the second and third
Expand Down