Skip to content

Commit ab31305

Browse files
committed
Update 'wistia' colormap.
1 parent 0a1b153 commit ab31305

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

lib/matplotlib/_cm.py

+17-15
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
from __future__ import (absolute_import, division, print_function,
99
unicode_literals)
10+
11+
import matplotlib.colors
1012
import numpy as np
1113

1214
_binary_data = {
@@ -1890,31 +1892,31 @@ def gfunc32(x):
18901892

18911893

18921894
# A color-blind-friendly heatmap from Wistia:
1895+
# https://github.com/wistia/heatmap-palette
18931896
# http://wistia.com/blog/heatmaps-for-colorblindness
18941897
#
18951898
# >>> import matplotlib.colors as c
1896-
# >>> colors = np.array([[228,255,122], [254,232,25], [250,190,6],
1897-
# ... [255,159,0], [252,127,0]], dtype=float) / 255
1898-
# ...
1899-
# >>> cm = col.LinearSegmentedColormap.from_list('wistia', colors)
1899+
# >>> colors = ["#e4ff7a", "#ffe81a", "#ffbd00", "#ffa000", "#fc7f00"]
1900+
# >>> cm = c.LinearSegmentedColormap.from_list('wistia', colors)
19001901
# >>> _wistia_data = cm._segmentdata
1902+
# >>> del _wistia_data['alpha']
19011903
#
19021904
_wistia_data = {
1903-
'red': [(0.0, 0.89411764705882357, 0.89411764705882357),
1904-
(0.25, 0.99607843137254903, 0.99607843137254903),
1905-
(0.5, 0.98039215686274506, 0.98039215686274506),
1905+
'red': [(0.0, 0.8941176470588236, 0.8941176470588236),
1906+
(0.25, 1.0, 1.0),
1907+
(0.5, 1.0, 1.0),
19061908
(0.75, 1.0, 1.0),
19071909
(1.0, 0.9882352941176471, 0.9882352941176471)],
19081910
'green': [(0.0, 1.0, 1.0),
1909-
(0.25, 0.90980392156862744, 0.90980392156862744),
1910-
(0.5, 0.74509803921568629, 0.74509803921568629),
1911-
(0.75, 0.62352941176470589, 0.62352941176470589),
1912-
(1.0, 0.49803921568627452, 0.49803921568627452)],
1911+
(0.25, 0.9098039215686274, 0.9098039215686274),
1912+
(0.5, 0.7411764705882353, 0.7411764705882353),
1913+
(0.75, 0.6274509803921569, 0.6274509803921569),
1914+
(1.0, 0.4980392156862745, 0.4980392156862745)],
19131915
'blue': [(0.0, 0.47843137254901963, 0.47843137254901963),
1914-
(0.25, 0.098039215686274508, 0.098039215686274508),
1915-
(0.5, 0.023529411764705882, 0.023529411764705882),
1916+
(0.25, 0.10196078431372549, 0.10196078431372549),
1917+
(0.5, 0.0, 0.0),
19161918
(0.75, 0.0, 0.0),
1917-
(1.0, 0.0, 0.0)]
1919+
(1.0, 0.0, 0.0)],
19181920
}
19191921

19201922

@@ -1993,4 +1995,4 @@ def gfunc32(x):
19931995
datad['gist_stern'] = _gist_stern_data
19941996
datad['gist_yarg'] = _gist_yarg_data
19951997
datad['coolwarm'] = _coolwarm_data
1996-
datad['wistia'] = _wistia_data
1998+
datad['Wistia'] = _wistia_data

0 commit comments

Comments
 (0)