diff --git a/lib/matplotlib/_cm.py b/lib/matplotlib/_cm.py index 7624b8a88bab..925cab4c78f7 100644 --- a/lib/matplotlib/_cm.py +++ b/lib/matplotlib/_cm.py @@ -1889,6 +1889,18 @@ def gfunc32(x): (0.875, 0.50, 0.50), (1.000, 1.00, 1.00))} +# Modification of CMRmap to improve linearity of luminance +# by Christopher Hummersone, BSD Licensed +# http://www.mathworks.com/matlabcentral/fileexchange/39552-modified-cmrmap +_CMRmap2_data = ((0.0, 0.0, 0.0), + (0.1, 0.1, 0.35), + (0.3, 0.15, 0.65), + (0.6, 0.2, 0.50), + (1.0, 0.25, 0.15), + (0.9, 0.55, 0.0), + (0.9, 0.75, 0.1), + (0.9, 0.9, 0.5), + (1.0, 1.0, 1.0)) # An MIT licensed, colorblind-friendly heatmap from Wistia: # https://github.com/wistia/heatmap-palette @@ -1927,6 +1939,7 @@ def gfunc32(x): 'bwr': _bwr_data, 'brg': _brg_data, 'CMRmap': _CMRmap_data, + 'CMRmap2': _CMRmap2_data, 'cool': _cool_data, 'copper': _copper_data, 'cubehelix': _cubehelix_data, diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 88979ec9bb5f..7dc171f40015 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -2106,6 +2106,8 @@ def colormaps(): maintains an aesthetically pleasing color image that automatically reproduces to a monotonic grayscale with discrete, quantifiable saturation levels." [#]_ + CMRmap2 Modified version of CMRmap that improves its luminosity + linearity for low values. [#]_ cubehelix Unlike most other color schemes cubehelix was designed by D.A. Green to be monotonically increasing in terms of perceived brightness. Also, when printed on a black @@ -2161,6 +2163,10 @@ def colormaps(): `_ by Carey Rappaport + .. [#] See `Modified CMRmap + `_ + by Christopher Hummersone + .. [#] Changed to distinguish from ColorBrewer's *Spectral* map. :func:`spectral` still works, but ``set_cmap('nipy_spectral')`` is recommended for clarity.