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

Skip to content

Add coolwarm color map. Revised patch. Originally submitted by Sameer Gro #486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 23, 2011
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Revised coolwarm color map with data from CoolWarmFloat33.csv
  • Loading branch information
cgohlke committed Sep 23, 2011
commit f16efdf0147c6c947a0fb651e25bde38c375a55c
206 changes: 103 additions & 103 deletions lib/matplotlib/_cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1628,113 +1628,113 @@ def gfunc32(x):
'blue': lambda x: 1 - x,
}

# This cool to warm color map was generated from Table 2 of
# "Diverging Color Maps for Scientific Visualization (Expanded)"
# by Kenneth Moreland. <http://www.cs.unm.edu/~kmorel/documents/ColorMaps/>
# This bipolar color map was generated from CoolWarmFloat33.csv of
# "Diverging Color Maps for Scientific Visualization" by Kenneth Moreland.
# <http://www.cs.unm.edu/~kmorel/documents/ColorMaps/>
_coolwarm_data = {
'red': [
(0.0, 0.23137255, 0.23137255),
(0.03125, 0.26666668, 0.26666668),
(0.0625, 0.3019608, 0.3019608),
(0.09375, 0.34117648, 0.34117648),
(0.125, 0.38431373, 0.38431373),
(0.15625, 0.42352942, 0.42352942),
(0.1875, 0.46666667, 0.46666667),
(0.21875, 0.50980395, 0.50980395),
(0.25, 0.5529412, 0.5529412),
(0.28125, 0.59607846, 0.59607846),
(0.3125, 0.63921571, 0.63921571),
(0.34375, 0.68235296, 0.68235296),
(0.375, 0.72156864, 0.72156864),
(0.40625, 0.76078433, 0.76078433),
(0.4375, 0.80000001, 0.80000001),
(0.46875, 0.83529413, 0.83529413),
(0.5, 0.86666667, 0.86666667),
(0.53125, 0.89803922, 0.89803922),
(0.5625, 0.9254902, 0.9254902),
(0.59375, 0.94509804, 0.94509804),
(0.625, 0.96078432, 0.96078432),
(0.65625, 0.96862745, 0.96862745),
(0.6875, 0.96862745, 0.96862745),
(0.71875, 0.96862745, 0.96862745),
(0.75, 0.95686275, 0.95686275),
(0.78125, 0.94509804, 0.94509804),
(0.8125, 0.9254902, 0.9254902),
(0.84375, 0.89803922, 0.89803922),
(0.875, 0.87058824, 0.87058824),
(0.90625, 0.83529413, 0.83529413),
(0.9375, 0.79607844, 0.79607844),
(0.96875, 0.75294119, 0.75294119),
(1.0, 0.70588237, 0.70588237)],
(0.0, 0.2298057, 0.2298057),
(0.03125, 0.26623388, 0.26623388),
(0.0625, 0.30386891, 0.30386891),
(0.09375, 0.342804478, 0.342804478),
(0.125, 0.38301334, 0.38301334),
(0.15625, 0.424369608, 0.424369608),
(0.1875, 0.46666708, 0.46666708),
(0.21875, 0.509635204, 0.509635204),
(0.25, 0.552953156, 0.552953156),
(0.28125, 0.596262162, 0.596262162),
(0.3125, 0.639176211, 0.639176211),
(0.34375, 0.681291281, 0.681291281),
(0.375, 0.722193294, 0.722193294),
(0.40625, 0.761464949, 0.761464949),
(0.4375, 0.798691636, 0.798691636),
(0.46875, 0.833466556, 0.833466556),
(0.5, 0.865395197, 0.865395197),
(0.53125, 0.897787179, 0.897787179),
(0.5625, 0.924127593, 0.924127593),
(0.59375, 0.944468518, 0.944468518),
(0.625, 0.958852946, 0.958852946),
(0.65625, 0.96732803, 0.96732803),
(0.6875, 0.969954137, 0.969954137),
(0.71875, 0.966811177, 0.966811177),
(0.75, 0.958003065, 0.958003065),
(0.78125, 0.943660866, 0.943660866),
(0.8125, 0.923944917, 0.923944917),
(0.84375, 0.89904617, 0.89904617),
(0.875, 0.869186849, 0.869186849),
(0.90625, 0.834620542, 0.834620542),
(0.9375, 0.795631745, 0.795631745),
(0.96875, 0.752534934, 0.752534934),
(1.0, 0.705673158, 0.705673158)],
'green': [
(0.0, 0.29803923, 0.29803923),
(0.03125, 0.35294119, 0.35294119),
(0.0625, 0.40784314, 0.40784314),
(0.09375, 0.45882353, 0.45882353),
(0.125, 0.50980395, 0.50980395),
(0.15625, 0.55686277, 0.55686277),
(0.1875, 0.60392159, 0.60392159),
(0.21875, 0.64705884, 0.64705884),
(0.25, 0.6901961, 0.6901961),
(0.28125, 0.72549021, 0.72549021),
(0.3125, 0.76078433, 0.76078433),
(0.34375, 0.78823531, 0.78823531),
(0.375, 0.81568629, 0.81568629),
(0.40625, 0.83529413, 0.83529413),
(0.4375, 0.8509804, 0.8509804),
(0.46875, 0.85882354, 0.85882354),
(0.5, 0.86666667, 0.86666667),
(0.53125, 0.84705883, 0.84705883),
(0.5625, 0.82745099, 0.82745099),
(0.59375, 0.80000001, 0.80000001),
(0.625, 0.76862746, 0.76862746),
(0.65625, 0.73333335, 0.73333335),
(0.6875, 0.69411767, 0.69411767),
(0.71875, 0.65098041, 0.65098041),
(0.75, 0.60392159, 0.60392159),
(0.78125, 0.5529412, 0.5529412),
(0.8125, 0.49803922, 0.49803922),
(0.84375, 0.43921569, 0.43921569),
(0.875, 0.3764706, 0.3764706),
(0.90625, 0.3137255, 0.3137255),
(0.9375, 0.24313726, 0.24313726),
(0.96875, 0.15686275, 0.15686275),
(1.0, 0.015686275, 0.015686275)],
(0.0, 0.298717966, 0.298717966),
(0.03125, 0.353094838, 0.353094838),
(0.0625, 0.406535296, 0.406535296),
(0.09375, 0.458757618, 0.458757618),
(0.125, 0.50941904, 0.50941904),
(0.15625, 0.558148092, 0.558148092),
(0.1875, 0.604562568, 0.604562568),
(0.21875, 0.648280772, 0.648280772),
(0.25, 0.688929332, 0.688929332),
(0.28125, 0.726149107, 0.726149107),
(0.3125, 0.759599947, 0.759599947),
(0.34375, 0.788964712, 0.788964712),
(0.375, 0.813952739, 0.813952739),
(0.40625, 0.834302879, 0.834302879),
(0.4375, 0.849786142, 0.849786142),
(0.46875, 0.860207984, 0.860207984),
(0.5, 0.86541021, 0.86541021),
(0.53125, 0.848937047, 0.848937047),
(0.5625, 0.827384882, 0.827384882),
(0.59375, 0.800927443, 0.800927443),
(0.625, 0.769767752, 0.769767752),
(0.65625, 0.734132809, 0.734132809),
(0.6875, 0.694266682, 0.694266682),
(0.71875, 0.650421156, 0.650421156),
(0.75, 0.602842431, 0.602842431),
(0.78125, 0.551750968, 0.551750968),
(0.8125, 0.49730856, 0.49730856),
(0.84375, 0.439559467, 0.439559467),
(0.875, 0.378313092, 0.378313092),
(0.90625, 0.312874446, 0.312874446),
(0.9375, 0.24128379, 0.24128379),
(0.96875, 0.157246067, 0.157246067),
(1.0, 0.01555616, 0.01555616)],
'blue': [
(0.0, 0.75294119, 0.75294119),
(0.03125, 0.80000001, 0.80000001),
(0.0625, 0.84313726, 0.84313726),
(0.09375, 0.88235295, 0.88235295),
(0.125, 0.91764706, 0.91764706),
(0.15625, 0.94509804, 0.94509804),
(0.1875, 0.96862745, 0.96862745),
(0.21875, 0.98431373, 0.98431373),
(0.25, 0.99607843, 0.99607843),
(0.28125, 1.0, 1.0),
(0.3125, 1.0, 1.0),
(0.34375, 0.99215686, 0.99215686),
(0.375, 0.97647059, 0.97647059),
(0.40625, 0.95686275, 0.95686275),
(0.4375, 0.93333334, 0.93333334),
(0.46875, 0.90196079, 0.90196079),
(0.5, 0.86666667, 0.86666667),
(0.53125, 0.81960785, 0.81960785),
(0.5625, 0.77254903, 0.77254903),
(0.59375, 0.72549021, 0.72549021),
(0.625, 0.67843139, 0.67843139),
(0.65625, 0.627451, 0.627451),
(0.6875, 0.58039218, 0.58039218),
(0.71875, 0.52941179, 0.52941179),
(0.75, 0.48235294, 0.48235294),
(0.78125, 0.43529412, 0.43529412),
(0.8125, 0.3882353, 0.3882353),
(0.84375, 0.34509805, 0.34509805),
(0.875, 0.3019608, 0.3019608),
(0.90625, 0.25882354, 0.25882354),
(0.9375, 0.21960784, 0.21960784),
(0.96875, 0.18431373, 0.18431373),
(1.0, 0.14901961, 0.14901961)]
}
(0.0, 0.753683153, 0.753683153),
(0.03125, 0.801466763, 0.801466763),
(0.0625, 0.84495867, 0.84495867),
(0.09375, 0.883725899, 0.883725899),
(0.125, 0.917387822, 0.917387822),
(0.15625, 0.945619588, 0.945619588),
(0.1875, 0.968154911, 0.968154911),
(0.21875, 0.98478814, 0.98478814),
(0.25, 0.995375608, 0.995375608),
(0.28125, 0.999836203, 0.999836203),
(0.3125, 0.998151185, 0.998151185),
(0.34375, 0.990363227, 0.990363227),
(0.375, 0.976574709, 0.976574709),
(0.40625, 0.956945269, 0.956945269),
(0.4375, 0.931688648, 0.931688648),
(0.46875, 0.901068838, 0.901068838),
(0.5, 0.865395561, 0.865395561),
(0.53125, 0.820880546, 0.820880546),
(0.5625, 0.774508472, 0.774508472),
(0.59375, 0.726736146, 0.726736146),
(0.625, 0.678007945, 0.678007945),
(0.65625, 0.628751763, 0.628751763),
(0.6875, 0.579375448, 0.579375448),
(0.71875, 0.530263762, 0.530263762),
(0.75, 0.481775914, 0.481775914),
(0.78125, 0.434243684, 0.434243684),
(0.8125, 0.387970225, 0.387970225),
(0.84375, 0.343229596, 0.343229596),
(0.875, 0.300267182, 0.300267182),
(0.90625, 0.259301199, 0.259301199),
(0.9375, 0.220525627, 0.220525627),
(0.96875, 0.184115123, 0.184115123),
(1.0, 0.150232812, 0.150232812)]
}


datad = {
Expand Down