From 1f5dd1d716ee2d78f224022fe9bf98b52f25fa7c Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Tue, 25 Oct 2022 16:31:20 +0200 Subject: [PATCH] Backport PR #24265: Restore (and warn on) seaborn styles in style.library --- lib/matplotlib/style/core.py | 69 ++++++++++++++++++------------ lib/matplotlib/tests/test_style.py | 2 + 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/lib/matplotlib/style/core.py b/lib/matplotlib/style/core.py index fb0a5426e61d..16d8af38f659 100644 --- a/lib/matplotlib/style/core.py +++ b/lib/matplotlib/style/core.py @@ -43,6 +43,32 @@ class __getattr__: 'toolbar', 'timezone', 'figure.max_open_warning', 'figure.raise_window', 'savefig.directory', 'tk.window_focus', 'docstring.hardcopy', 'date.epoch'} +_DEPRECATED_SEABORN_STYLES = { + s: s.replace("seaborn", "seaborn-v0_8") + for s in [ + "seaborn", + "seaborn-bright", + "seaborn-colorblind", + "seaborn-dark", + "seaborn-darkgrid", + "seaborn-dark-palette", + "seaborn-deep", + "seaborn-muted", + "seaborn-notebook", + "seaborn-paper", + "seaborn-pastel", + "seaborn-poster", + "seaborn-talk", + "seaborn-ticks", + "seaborn-white", + "seaborn-whitegrid", + ] +} +_DEPRECATED_SEABORN_MSG = ( + "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 'seaborn-v0_8-