Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4da0a1d

Browse files
committed
Remove the deprecated matplotlib.cm.revcmap()
1 parent 8676c27 commit 4da0a1d

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
``matplotlib.cm`` removals
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
- ``matplotlib.cm.revcmap()`` has been removed. Use ``Colormap.reversed()``
5+
instead.

lib/matplotlib/cm.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"""
1717

1818
from collections.abc import MutableMapping
19-
import functools
2019

2120
import numpy as np
2221
from numpy import ma
@@ -28,25 +27,6 @@
2827
from matplotlib._cm_listed import cmaps as cmaps_listed
2928

3029

31-
def _reverser(f, x): # Deprecated, remove this at the same time as revcmap.
32-
return f(1 - x) # Toplevel helper for revcmap ensuring cmap picklability.
33-
34-
35-
@cbook.deprecated("3.2", alternative="Colormap.reversed()")
36-
def revcmap(data):
37-
"""Can only handle specification *data* in dictionary format."""
38-
data_r = {}
39-
for key, val in data.items():
40-
if callable(val):
41-
# Return a partial object so that the result is picklable.
42-
valnew = functools.partial(_reverser, val)
43-
else:
44-
# Flip x and exchange the y values facing x = 0 and x = 1.
45-
valnew = [(1.0 - x, y1, y0) for x, y0, y1 in reversed(val)]
46-
data_r[key] = valnew
47-
return data_r
48-
49-
5030
LUTSIZE = mpl.rcParams['image.lut']
5131

5232

0 commit comments

Comments
 (0)