|
56 | 56 | middle value, such as topography or when the data deviates around |
57 | 57 | zero. |
58 | 58 |
|
59 | | -3. Qualitative: often are miscellaneous colors; should be used to |
| 59 | +3. Wrapping: change in lightness of two different colors that meet in |
| 60 | + the middle and beginning/end at an unsaturated color; should be |
| 61 | + used for values that wrap around at the endpoints, such as phase |
| 62 | + angle, wind direction, or time of day. |
| 63 | +
|
| 64 | +4. Qualitative: often are miscellaneous colors; should be used to |
60 | 65 | represent information which does not have ordering or |
61 | 66 | relationships. |
62 | 67 | """ |
|
124 | 129 | 'PiYG', 'PRGn', 'BrBG', 'PuOr', 'RdGy', 'RdBu', |
125 | 130 | 'RdYlBu', 'RdYlGn', 'Spectral', 'coolwarm', 'bwr', 'seismic'] |
126 | 131 |
|
| 132 | +############################################################################### |
| 133 | +# Wrapping |
| 134 | +# -------- |
| 135 | +# |
| 136 | +# For Wrapping maps, we want to start and end on the same color, and meet a |
| 137 | +# symmetric center point in the middle. :math:`L^*` should change monotonically |
| 138 | +# from start to middle, and inversely from middle to end. It should be symmetric |
| 139 | +# on the increasing and decreasing side, and only differ in hue. At the ends and |
| 140 | +# middle, :math:`L^*` will reverse direction, which should be smoothed in |
| 141 | +# :math:`L^*` space to reduce artifacts. See [kovesi-colormaps]_ for more |
| 142 | +# information on the design of wrapping maps. |
| 143 | +# |
| 144 | +# The often-used HSV colormap is included in this set of colormaps, although it |
| 145 | +# is not symmetric to a center point. Additionally, the :math:`L^*` values vary |
| 146 | +# widely throughout the colormap, making it a poor choice for representing data |
| 147 | +# for viewers to see perceptually. See an extension on this idea at |
| 148 | +# [mycarta-jet]_. |
| 149 | + |
| 150 | +cmaps['Wrapping'] = ['twilight', 'sunlight', 'hsv'] |
| 151 | + |
127 | 152 | ############################################################################### |
128 | 153 | # Qualitative |
129 | 154 | # ----------- |
|
158 | 183 |
|
159 | 184 | cmaps['Miscellaneous'] = [ |
160 | 185 | 'flag', 'prism', 'ocean', 'gist_earth', 'terrain', 'gist_stern', |
161 | | - 'gnuplot', 'gnuplot2', 'CMRmap', 'cubehelix', 'brg', 'hsv', |
| 186 | + 'gnuplot', 'gnuplot2', 'CMRmap', 'cubehelix', 'brg', |
162 | 187 | 'gist_rainbow', 'rainbow', 'jet', 'nipy_spectral', 'gist_ncar'] |
163 | 188 |
|
164 | 189 | ############################################################################### |
@@ -206,13 +231,13 @@ def plot_color_gradients(cmap_category, cmap_list, nrows): |
206 | 231 |
|
207 | 232 | # Number of colormap per subplot for particular cmap categories |
208 | 233 | _DSUBS = {'Perceptually Uniform Sequential': 5, 'Sequential': 6, |
209 | | - 'Sequential (2)': 6, 'Diverging': 6, 'Qualitative': 4, |
210 | | - 'Miscellaneous': 6} |
| 234 | + 'Sequential (2)': 6, 'Diverging': 6, 'Wrapping': 3, |
| 235 | + 'Qualitative': 4, 'Miscellaneous': 6} |
211 | 236 |
|
212 | 237 | # Spacing between the colormaps of a subplot |
213 | 238 | _DC = {'Perceptually Uniform Sequential': 1.4, 'Sequential': 0.7, |
214 | | - 'Sequential (2)': 1.4, 'Diverging': 1.4, 'Qualitative': 1.4, |
215 | | - 'Miscellaneous': 1.4} |
| 239 | + 'Sequential (2)': 1.4, 'Diverging': 1.4, 'Wrapping': 1.4, |
| 240 | + 'Qualitative': 1.4, 'Miscellaneous': 1.4} |
216 | 241 |
|
217 | 242 | # Indices to step through colormap |
218 | 243 | x = np.linspace(0.0, 1.0, 100) |
@@ -388,6 +413,7 @@ def plot_color_gradients(cmap_category, cmap_list): |
388 | 413 | # .. [list-colormaps] https://gist.github.com/endolith/2719900#id7 |
389 | 414 | # .. [mycarta-banding] https://mycarta.wordpress.com/2012/10/14/the-rainbow-is-deadlong-live-the-rainbow-part-4-cie-lab-heated-body/ |
390 | 415 | # .. [mycarta-jet] https://mycarta.wordpress.com/2012/10/06/the-rainbow-is-deadlong-live-the-rainbow-part-3/ |
| 416 | +# .. [kovesi-colormaps] https://arxiv.org/abs/1509.03700 |
391 | 417 | # .. [bw] http://www.tannerhelland.com/3643/grayscale-image-algorithm-vb6/ |
392 | 418 | # .. [colorblindness] http://www.color-blindness.com/ |
393 | 419 | # .. [vischeck] http://www.vischeck.com/vischeck/ |
|
0 commit comments