File tree Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,27 @@ def {name}():
87
87
88
88
"""
89
89
90
+ CMAP_TEMPLATE_DEPRECATED = AUTOGEN_MSG + """
91
+ def {name}():
92
+ '''
93
+ set the default colormap to {name} and apply to current image if any.
94
+ See help(colormaps) for more information
95
+ '''
96
+ from matplotlib.cbook import warn_deprecated
97
+ warn_deprecated(
98
+ "2.0",
99
+ name="{name}",
100
+ obj_type="colormap"
101
+ )
102
+
103
+ rc('image', cmap='{name}')
104
+ im = gci()
105
+
106
+ if im is not None:
107
+ im.set_cmap(cm.{name})
108
+
109
+ """
110
+
90
111
91
112
def boilerplate_gen ():
92
113
"""Generator of lines for the automated part of pyplot."""
@@ -322,16 +343,18 @@ def format_value(value):
322
343
'spring' ,
323
344
'summer' ,
324
345
'winter' ,
325
- 'spectral' ,
326
-
327
346
'magma' ,
328
347
'inferno' ,
329
348
'plasma' ,
330
- 'viridis'
349
+ 'viridis' ,
350
+ "nipy_spectral"
331
351
)
352
+ deprecated_cmaps = ("spectral" , )
332
353
# add all the colormaps (autumn, hsv, ....)
333
354
for name in cmaps :
334
355
yield CMAP_TEMPLATE .format (name = name )
356
+ for name in deprecated_cmaps :
357
+ yield CMAP_TEMPLATE_DEPRECATED .format (name = name )
335
358
336
359
yield ''
337
360
yield '_setup_pyplot_info_docstrings()'
You can’t perform that action at this time.
0 commit comments