File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
Original file line number Diff line number Diff line change 9
9
from __future__ import (absolute_import , division , print_function ,
10
10
unicode_literals )
11
11
12
+ from matplotlib .cbook import warn_deprecated
12
13
import numpy as np
13
14
14
15
_binary_data = {
@@ -1365,7 +1366,19 @@ def gfunc32(x):
1365
1366
)
1366
1367
1367
1368
1368
- datad = {
1369
+ class _deprecation_datad (dict ):
1370
+ def __getitem__ (self , key ):
1371
+ if key == "spectral" :
1372
+ warn_deprecated (
1373
+ "2.0" ,
1374
+ name = "spectral" ,
1375
+ alternative = "nipy_spectral" ,
1376
+ obj_type = "colormap"
1377
+ )
1378
+ return super (_deprecation_datad , self ).__getitem__ (key )
1379
+
1380
+
1381
+ datad = _deprecation_datad ({
1369
1382
'afmhot' : _afmhot_data ,
1370
1383
'autumn' : _autumn_data ,
1371
1384
'bone' : _bone_data ,
@@ -1394,7 +1407,7 @@ def gfunc32(x):
1394
1407
'winter' : _winter_data ,
1395
1408
'nipy_spectral' : _nipy_spectral_data ,
1396
1409
'spectral' : _nipy_spectral_data , # alias for backward compatibility
1397
- }
1410
+ })
1398
1411
1399
1412
1400
1413
datad ['Blues' ] = _Blues_data
Original file line number Diff line number Diff line change 16
16
import matplotlib as mpl
17
17
import matplotlib .colors as colors
18
18
import matplotlib .cbook as cbook
19
- from matplotlib ._cm import datad
19
+ from matplotlib ._cm import datad , _deprecation_datad
20
20
from matplotlib ._cm import cubehelix
21
21
from matplotlib ._cm_listed import cmaps as cmaps_listed
22
22
23
- cmap_d = dict ()
23
+ cmap_d = _deprecation_datad ()
24
24
25
25
# reverse all the colormaps.
26
26
# reversed colormaps have '_r' appended to the name.
You can’t perform that action at this time.
0 commit comments