diff --git a/CHANGELOG b/CHANGELOG index 06b958a03c9c..9f1b2c86ca5b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,11 @@ +2014-05-02 Added colorblind-friendly colormap, named 'Wistia'. + 2014-04-27 Improved input clean up in Axes.{h|v}lines - Coerce input into a 1D ndarrays (after dealing with units). + Coerce input into a 1D ndarrays (after dealing with units). 2014-04-22 Added an example showing the difference between - interpolation = 'none' and interpolation = 'nearest' in - `imshow()` when saving vector graphics files. + interpolation = 'none' and interpolation = 'nearest' in + `imshow()` when saving vector graphics files. 2014-04-10 Fixed the triangular marker rendering error. The "Up" triangle was rendered instead of "Right" triangle and vice-versa. @@ -11,16 +13,12 @@ 2014-04-08 Fixed a bug in parasite_axes.py by making a list out of a generator at line 263. -2014-02-25 In backend_qt4agg changed from using update -> repaint under - windows. See comment in source near `self._priv_update` for - longer explaination. - 2014-03-27 Added tests for pie ccw parameter. Removed pdf and svg images from tests for pie linewidth parameter. 2014-03-24 Added bool kwarg (manage_xticks) to boxplot to enable/disable - the managemnet of the xlimits and ticks when making a boxplot. - Default in True which maintains current behavior by default. + the managemnet of the xlimits and ticks when making a boxplot. + Default in True which maintains current behavior by default. 2014-03-22 Added the keyword arguments wedgeprops and textprops to pie. Users can control the wedge and text properties of the pie @@ -32,9 +30,13 @@ 2014-03-13 Add parameter 'clockwise' to function pie, True by default. -2014-27-02 Implemented separate horizontal/vertical axes padding to the +2014-02-27 Implemented separate horizontal/vertical axes padding to the ImageGrid in the AxesGrid toolkit +2014-02-25 In backend_qt4agg changed from using update -> repaint under + windows. See comment in source near `self._priv_update` for + longer explaination. + 2014-01-02 `triplot` now returns the artist it adds and support of line and marker kwargs has been improved. GBY @@ -53,7 +55,7 @@ matplotlib.delaunay module. - IMT 2013-11-05 Add power-law normalization method. This is useful for, - e.g., showing small populations in a "hist2d" histogram. + e.g., showing small populations in a "hist2d" histogram. 2013-10-27 Added get_rlabel_position and set_rlabel_position methods to PolarAxes to control angular position of radial tick labels. diff --git a/doc/users/whats_new.rst b/doc/users/whats_new.rst index f2edd13786c8..3b46a2f8376d 100644 --- a/doc/users/whats_new.rst +++ b/doc/users/whats_new.rst @@ -23,6 +23,17 @@ revision, see the :ref:`github-stats`. new in matplotlib-1.4 ===================== + +New colormap +------------ +In heatmaps, a green-to-red spectrum is often used to indicate intensity of +activity, but this can be problematic for the red/green colorblind. A new, +colorblind-friendly colormap is now available at :class:`matplotlib.cm.Wistia`. +This colormap maintains the red/green symbolism while achieving deuteranopic +legibility through brightness variations. See +`here ` +for more information. + Documentation changes --------------------- diff --git a/lib/matplotlib/_cm.py b/lib/matplotlib/_cm.py index 601f25a3f92b..7624b8a88bab 100644 --- a/lib/matplotlib/_cm.py +++ b/lib/matplotlib/_cm.py @@ -7,6 +7,7 @@ from __future__ import (absolute_import, division, print_function, unicode_literals) + import numpy as np _binary_data = { @@ -1888,6 +1889,36 @@ def gfunc32(x): (0.875, 0.50, 0.50), (1.000, 1.00, 1.00))} + +# An MIT licensed, colorblind-friendly heatmap from Wistia: +# https://github.com/wistia/heatmap-palette +# http://wistia.com/blog/heatmaps-for-colorblindness +# +# >>> import matplotlib.colors as c +# >>> colors = ["#e4ff7a", "#ffe81a", "#ffbd00", "#ffa000", "#fc7f00"] +# >>> cm = c.LinearSegmentedColormap.from_list('wistia', colors) +# >>> _wistia_data = cm._segmentdata +# >>> del _wistia_data['alpha'] +# +_wistia_data = { + 'red': [(0.0, 0.8941176470588236, 0.8941176470588236), + (0.25, 1.0, 1.0), + (0.5, 1.0, 1.0), + (0.75, 1.0, 1.0), + (1.0, 0.9882352941176471, 0.9882352941176471)], + 'green': [(0.0, 1.0, 1.0), + (0.25, 0.9098039215686274, 0.9098039215686274), + (0.5, 0.7411764705882353, 0.7411764705882353), + (0.75, 0.6274509803921569, 0.6274509803921569), + (1.0, 0.4980392156862745, 0.4980392156862745)], + 'blue': [(0.0, 0.47843137254901963, 0.47843137254901963), + (0.25, 0.10196078431372549, 0.10196078431372549), + (0.5, 0.0, 0.0), + (0.75, 0.0, 0.0), + (1.0, 0.0, 0.0)], +} + + datad = { 'afmhot': _afmhot_data, 'autumn': _autumn_data, @@ -1963,3 +1994,4 @@ def gfunc32(x): datad['gist_stern'] = _gist_stern_data datad['gist_yarg'] = _gist_yarg_data datad['coolwarm'] = _coolwarm_data +datad['Wistia'] = _wistia_data