Skip to content

Commit 8d41551

Browse files
authored
Merge pull request #7971 from NelleV/deprecate_vega_names
MAINT vega colormaps are deprecated in favor of tab
2 parents 729d219 + 8496ef9 commit 8d41551

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

doc/users/whats_new/deprecations.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Deprecations
2+
------------
3+
4+
- The "Vega" colormaps are deprecated in Matplotlib 2.0.1 and will be removed
5+
in Matplotlib 2.2. Use the "tab" colormaps instead: "tab10", "tab20",
6+
"tab20b", "tab20c".

examples/color/colormaps_reference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral',
5252
'seismic']),
5353
('Qualitative', ['Accent', 'Dark2', 'Paired', 'Pastel1',
54-
'Pastel2', 'Set1', 'Set2', 'Set3', 'Vega10',
55-
'Vega20', 'Vega20b', 'Vega20c']),
54+
'Pastel2', 'Set1', 'Set2', 'Set3', 'tab10',
55+
'tab20', 'tab20b', 'tab20c']),
5656
('Miscellaneous', ['gist_earth', 'terrain', 'ocean', 'gist_stern',
5757
'brg', 'CMRmap', 'cubehelix',
5858
'gnuplot', 'gnuplot2', 'gist_ncar',

lib/matplotlib/_cm.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ def gfunc32(x):
12831283
# (divided by 255)
12841284
#
12851285

1286-
_Vega10_data = (
1286+
_tab10_data = (
12871287
(0.12156862745098039, 0.4666666666666667, 0.7058823529411765 ), # 1f77b4
12881288
(1.0, 0.4980392156862745, 0.054901960784313725), # ff7f0e
12891289
(0.17254901960784313, 0.6274509803921569, 0.17254901960784313 ), # 2ca02c
@@ -1296,7 +1296,7 @@ def gfunc32(x):
12961296
(0.09019607843137255, 0.7450980392156863, 0.8117647058823529), # 17becf
12971297
)
12981298

1299-
_Vega20_data = (
1299+
_tab20_data = (
13001300
(0.12156862745098039, 0.4666666666666667, 0.7058823529411765 ), # 1f77b4
13011301
(0.6823529411764706, 0.7803921568627451, 0.9098039215686274 ), # aec7e8
13021302
(1.0, 0.4980392156862745, 0.054901960784313725), # ff7f0e
@@ -1319,7 +1319,7 @@ def gfunc32(x):
13191319
(0.6196078431372549, 0.8549019607843137, 0.8980392156862745), # 9edae5
13201320
)
13211321

1322-
_Vega20b_data = (
1322+
_tab20b_data = (
13231323
(0.2235294117647059, 0.23137254901960785, 0.4745098039215686 ), # 393b79
13241324
(0.3215686274509804, 0.32941176470588235, 0.6392156862745098 ), # 5254a3
13251325
(0.4196078431372549, 0.43137254901960786, 0.8117647058823529 ), # 6b6ecf
@@ -1342,7 +1342,7 @@ def gfunc32(x):
13421342
(0.8705882352941177, 0.6196078431372549, 0.8392156862745098 ), # de9ed6
13431343
)
13441344

1345-
_Vega20c_data = (
1345+
_tab20c_data = (
13461346
(0.19215686274509805, 0.5098039215686274, 0.7411764705882353 ), # 3182bd
13471347
(0.4196078431372549, 0.6823529411764706, 0.8392156862745098 ), # 6baed6
13481348
(0.6196078431372549, 0.792156862745098, 0.8823529411764706 ), # 9ecae1
@@ -1380,6 +1380,15 @@ def __getitem__(self, key):
13801380
alternative="nipy_spectral and nipy_spectral_r",
13811381
obj_type="colormap"
13821382
)
1383+
elif key in ["Vega10", "Vega10_r", "Vega20", "Vega20_r", "Vega20b",
1384+
"Vega20b_r", "Vega20c", "Vega20c_r"]:
1385+
warn_deprecated(
1386+
"2.0",
1387+
name="Vega colormaps",
1388+
alternative="tab",
1389+
obj_type="colormap"
1390+
)
1391+
13831392
return super(_deprecation_datad, self).__getitem__(key)
13841393

13851394

@@ -1465,7 +1474,12 @@ def __getitem__(self, key):
14651474
datad['Set2'] = {'listed': _Set2_data}
14661475
datad['Set3'] = {'listed': _Set3_data}
14671476

1468-
datad['Vega10'] = {'listed': _Vega10_data}
1469-
datad['Vega20'] = {'listed': _Vega20_data}
1470-
datad['Vega20b'] = {'listed': _Vega20b_data}
1471-
datad['Vega20c'] = {'listed': _Vega20c_data}
1477+
datad['tab10'] = {'listed': _tab10_data}
1478+
datad['tab20'] = {'listed': _tab20_data}
1479+
datad['tab20b'] = {'listed': _tab20b_data}
1480+
datad['tab20c'] = {'listed': _tab20c_data}
1481+
1482+
datad['Vega10'] = {'listed': _tab10_data}
1483+
datad['Vega20'] = {'listed': _tab20_data}
1484+
datad['Vega20b'] = {'listed': _tab20b_data}
1485+
datad['Vega20c'] = {'listed': _tab20c_data}

0 commit comments

Comments
 (0)