Skip to content

Commit 0c5e832

Browse files
authored
Merge pull request matplotlib#18502 from timhoffm/remove-revcmap
Remove the deprecated matplotlib.cm.revcmap()
2 parents 6bd5d9b + 4da0a1d commit 0c5e832

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
@@ -27,25 +26,6 @@
2726
from matplotlib._cm_listed import cmaps as cmaps_listed
2827

2928

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

5131

0 commit comments

Comments
 (0)