We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5655cf2 + 566dd14 commit f608f25Copy full SHA for f608f25
cooltools/lib/plotting.py
@@ -5,7 +5,8 @@
5
try:
6
from matplotlib.cm import register_cmap
7
except ImportError:
8
- from matplotlib.colormaps import register
+ from matplotlib import colormaps
9
+ register_cmap = colormaps.register
10
11
import matplotlib as mpl
12
import matplotlib.pyplot as plt
@@ -99,8 +100,8 @@ def get_cmap(name):
99
100
101
def _register_cmaps():
102
for name, pal in PALETTES.items():
- register_cmap(name, list_to_colormap(pal))
103
- register_cmap(name + "_r", list_to_colormap(pal[::-1]))
+ register_cmap(list_to_colormap(pal), name=name)
104
+ register_cmap(list_to_colormap(pal[::-1]), name=name + "_r")
105
106
107
_register_cmaps()
0 commit comments