Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc277c78

Browse files
committed
Rename outdated seaborn styles.
... while keeping them available under a versioned name for backcompat.
1 parentfd51e05 commitc277c78

17 files changed

+33
-5
lines changed

‎lib/matplotlib/style/core.py

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,45 @@ def use(style):
102102
103103
%s
104104
"""
105-
style_alias= {'mpl20':'default',
106-
'mpl15':'classic'}
107105
ifisinstance(style, (str,Path))orhasattr(style,'keys'):
108106
# If name is a single str, Path or dict, make it a single element list.
109107
styles= [style]
110108
else:
111109
styles=style
112110

113-
styles= (style_alias.get(s,s)ifisinstance(s,str)elses
114-
forsinstyles)
115-
forstyleinstyles:
111+
style_alias= {'mpl20':'default','mpl15':'classic'}
112+
113+
deffix_style(s):
114+
ifisinstance(s,str):
115+
s=style_alias.get(s,s)
116+
ifsin [
117+
"seaborn",
118+
"seaborn-bright",
119+
"seaborn-colorblind",
120+
"seaborn-dark",
121+
"seaborn-darkgrid",
122+
"seaborn-dark-palette",
123+
"seaborn-deep",
124+
"seaborn-muted",
125+
"seaborn-notebook",
126+
"seaborn-paper",
127+
"seaborn-pastel",
128+
"seaborn-poster",
129+
"seaborn-talk",
130+
"seaborn-ticks",
131+
"seaborn-white",
132+
"seaborn-whitegrid",
133+
]:
134+
_api.warn_deprecated(
135+
"3.6",message="The seaborn styles shipped by Matplotlib "
136+
"are deprecated since %(since)s, as they no longer "
137+
"correspond to the styles shipped by seaborn. However, "
138+
"they will remain available as 'seaborn0.8-<style>'. "
139+
"Alternatively, directly use the seaborn API instead.")
140+
s=s.replace("seaborn","seaborn0.8")
141+
returns
142+
143+
forstyleinmap(fix_style,styles):
116144
ifnotisinstance(style, (str,Path)):
117145
_apply_style(style)
118146
elifstyle=='default':

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp