From c847be2c9e06177be5dbad5bd17a8b3b44bf9fc6 Mon Sep 17 00:00:00 2001 From: "Adrien F. VINCENT" Date: Mon, 20 Feb 2017 19:00:03 +0100 Subject: [PATCH 1/6] Add missing colormaps to the relevant doc pages --- doc/users/plotting/colormaps/colormaps.py | 9 +++++---- examples/color/colormaps_reference.py | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/users/plotting/colormaps/colormaps.py b/doc/users/plotting/colormaps/colormaps.py index a7dbf27e38a9..6f05f0ee8d85 100644 --- a/doc/users/plotting/colormaps/colormaps.py +++ b/doc/users/plotting/colormaps/colormaps.py @@ -7,14 +7,15 @@ 'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd', 'PuBu', 'PuBuGn', 'PuRd', 'Purples', 'RdPu', 'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd']), - ('Sequential (2)', ['afmhot', 'autumn', 'bone', 'cool', - 'copper', 'gist_heat', 'gray', 'hot', - 'pink', 'spring', 'summer', 'winter']), + ('Sequential (2)', ['afmhot', 'autumn', 'bone', 'cool', 'copper', + 'gist_heat', 'gray', 'hot', 'pink', 'spring', + 'summer', 'winter', 'Wistia']), ('Diverging', ['BrBG', 'bwr', 'coolwarm', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral', 'seismic']), ('Qualitative', ['Accent', 'Dark2', 'Paired', 'Pastel1', - 'Pastel2', 'Set1', 'Set2', 'Set3']), + 'Pastel2', 'Set1', 'Set2', 'Set3', 'tab10', + 'tab20', 'tab20b', 'tab20c']), ('Miscellaneous', ['gist_earth', 'terrain', 'ocean', 'gist_stern', 'brg', 'CMRmap', 'cubehelix', 'gnuplot', 'gnuplot2', 'gist_ncar', diff --git a/examples/color/colormaps_reference.py b/examples/color/colormaps_reference.py index 3cca581cbe17..0de8f1cc9819 100644 --- a/examples/color/colormaps_reference.py +++ b/examples/color/colormaps_reference.py @@ -49,8 +49,8 @@ 'PuBu', 'PuBuGn', 'PuRd', 'Purples', 'RdPu', 'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd']), ('Sequential (2)', ['afmhot', 'autumn', 'bone', 'cool', - 'copper', 'gist_heat', 'gray', 'hot', - 'pink', 'spring', 'summer', 'winter']), + 'copper', 'gist_heat', 'gray', 'hot', 'pink', + 'spring', 'summer', 'winter', 'Wistia']), ('Diverging', ['BrBG', 'bwr', 'coolwarm', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral', 'seismic']), From 38526b4f950b04336c65a194026ff2f4f9fdcc1a Mon Sep 17 00:00:00 2001 From: "Adrien F. VINCENT" Date: Sun, 26 Feb 2017 11:03:08 +0100 Subject: [PATCH 2/6] tweak cmap list order for a better fit of "Wistia" --- doc/users/plotting/colormaps/colormaps.py | 2 +- examples/color/colormaps_reference.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/users/plotting/colormaps/colormaps.py b/doc/users/plotting/colormaps/colormaps.py index 6f05f0ee8d85..750678b4cdc9 100644 --- a/doc/users/plotting/colormaps/colormaps.py +++ b/doc/users/plotting/colormaps/colormaps.py @@ -9,7 +9,7 @@ 'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd']), ('Sequential (2)', ['afmhot', 'autumn', 'bone', 'cool', 'copper', 'gist_heat', 'gray', 'hot', 'pink', 'spring', - 'summer', 'winter', 'Wistia']), + 'Wistia', 'summer', 'winter']), ('Diverging', ['BrBG', 'bwr', 'coolwarm', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral', 'seismic']), diff --git a/examples/color/colormaps_reference.py b/examples/color/colormaps_reference.py index 0de8f1cc9819..3c37d522208f 100644 --- a/examples/color/colormaps_reference.py +++ b/examples/color/colormaps_reference.py @@ -50,7 +50,7 @@ 'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd']), ('Sequential (2)', ['afmhot', 'autumn', 'bone', 'cool', 'copper', 'gist_heat', 'gray', 'hot', 'pink', - 'spring', 'summer', 'winter', 'Wistia']), + 'spring', 'Wistia', 'summer', 'winter']), ('Diverging', ['BrBG', 'bwr', 'coolwarm', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral', 'seismic']), From a769e5b3afe317f8626738f611c33bfb29f2b6b8 Mon Sep 17 00:00:00 2001 From: "Adrien F. VINCENT" Date: Sun, 26 Feb 2017 11:35:38 +0100 Subject: [PATCH 3/6] Cleaning up 'grayscale.py' script --- doc/users/plotting/colormaps/grayscale.py | 30 +++++++++++------------ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/doc/users/plotting/colormaps/grayscale.py b/doc/users/plotting/colormaps/grayscale.py index 7d3e9f38aeac..030134197f23 100644 --- a/doc/users/plotting/colormaps/grayscale.py +++ b/doc/users/plotting/colormaps/grayscale.py @@ -1,39 +1,37 @@ ''' -Show what matplotlib colormaps look like in grayscale. +================================== +Grayscale version of the colormaps +================================== + +Show what Matplotlib colormaps look like in grayscale. Uses lightness L* as a proxy for grayscale value. ''' -from colormaps import cmaps - -#from skimage import color -# we are using a local copy of colorconv from scikit-image to reduce dependencies. -# You should probably use the one from scikit-image in most cases. import numpy as np +import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import cm -import matplotlib as mpl from colorspacious import cspace_converter +from colormaps import cmaps # the colormaps, grouped by category mpl.rcParams.update({'font.size': 14}) - -# indices to step through colormap +# Indices to step through colormap. x = np.linspace(0.0, 1.0, 100) -# nrows = max(len(cmap_list) for cmap_category, cmap_list in cmaps) gradient = np.linspace(0, 1, 256) gradient = np.vstack((gradient, gradient)) + def plot_color_gradients(cmap_category, cmap_list): - nrows = len(cmap_list) - fig, axes = plt.subplots(nrows=nrows, ncols=2) + fig, axes = plt.subplots(nrows=len(cmap_list), ncols=2) fig.subplots_adjust(top=0.95, bottom=0.01, left=0.2, right=0.99, wspace=0.05) fig.suptitle(cmap_category + ' colormaps', fontsize=14, y=1.0, x=0.6) for ax, name in zip(axes, cmap_list): - # Get rgb values for colormap + # Get RGB values for colormap. rgb = cm.get_cmap(plt.get_cmap(name))(x)[np.newaxis,:,:3] # Get colormap in CAM02-UCS colorspace. We want the lightness. @@ -49,9 +47,9 @@ def plot_color_gradients(cmap_category, cmap_list): fig.text(x_text, y_text, name, va='center', ha='right', fontsize=10) # Turn off *all* ticks & spines, not just the ones with colormaps. - for ax in axes: - ax[0].set_axis_off() - ax[1].set_axis_off() + for ax in axes.flat: + ax.set_axis_off() + plt.show() From 0c9a2805f880837a1d98ec2ca9f2c308ef56cf40 Mon Sep 17 00:00:00 2001 From: "Adrien F. VINCENT" Date: Sun, 26 Feb 2017 11:36:28 +0100 Subject: [PATCH 4/6] Overhaul and refactoring of the 'lightness.py' script --- doc/users/plotting/colormaps/lightness.py | 150 ++++++++++------------ 1 file changed, 65 insertions(+), 85 deletions(-) diff --git a/doc/users/plotting/colormaps/lightness.py b/doc/users/plotting/colormaps/lightness.py index cd9950fd4d82..8c41e702b7cf 100644 --- a/doc/users/plotting/colormaps/lightness.py +++ b/doc/users/plotting/colormaps/lightness.py @@ -1,120 +1,100 @@ ''' +========================== +Lightness of the colormaps +========================== + For each colormap, plot the lightness parameter L* from CIELAB colorspace along the y axis vs index through the colormap. Colormaps are examined in categories as in the original matplotlib gallery of colormaps. ''' -from colormaps import cmaps import numpy as np +import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import cm -import matplotlib as mpl from colorspacious import cspace_converter +from colormaps import cmaps # the colormaps, grouped by category mpl.rcParams.update({'font.size': 12}) -# indices to step through colormap +# Number of colormap par subplot for particular cmap categories +_DSUBS = {'Perceptually Uniform Sequential': 4, 'Sequential': 6, + 'Sequential (2)': 5, 'Diverging': 6, 'Qualitative': 4, + 'Miscellaneous': 6} + +# Spacing between the colormaps of a subplot +_DC = {'Perceptually Uniform Sequential': 1.15, 'Sequential': 0.6, + 'Sequential (2)': 1.15, 'Diverging': 1.3, 'Qualitative': 1.3, + 'Miscellaneous': 1.4} + +# Indices to step through colormap x = np.linspace(0.0, 1.0, 100) # Do plot for cmap_category, cmap_list in cmaps: - # Do subplots so that colormaps have enough space. 5 per subplot? - dsub = 5 # number of colormaps per subplot - if cmap_category == 'Diverging': # because has 12 colormaps - dsub = 6 - elif cmap_category == 'Sequential (2)': - dsub = 6 - elif cmap_category == 'Sequential': - dsub = 7 - nsubplots = int(np.ceil(len(cmap_list)/float(dsub))) - - fig = plt.figure(figsize=(7,2.6*nsubplots)) + # Do subplots so that colormaps have enough space. + # Default is 5 colormaps per subplot. + dsub = _DSUBS.get(cmap_category, 5) + nsubplots = int(np.ceil(len(cmap_list) / float(dsub))) - for i, subplot in enumerate(range(nsubplots)): + # squeeze=False to handle similarly the case of a single subplot + fig, axes = plt.subplots(nrows=nsubplots, squeeze=False, + figsize=(7, 2.6*nsubplots)) - locs = [] # locations for text labels + for i, ax in enumerate(axes.flat): - ax = fig.add_subplot(nsubplots, 1, i+1) + locs = [] # locations for text labels for j, cmap in enumerate(cmap_list[i*dsub:(i+1)*dsub]): - # Get rgb values for colormap - rgb = cm.get_cmap(cmap)(x)[np.newaxis,:,:3] - - # Get colormap in CAM02-UCS colorspace. We want the lightness. + # Get RGB values for colormap and convert the colormap in + # CAM02-UCS colorspace. lab[0, :, 0] is the lightness. + rgb = cm.get_cmap(cmap)(x)[np.newaxis, :, :3] lab = cspace_converter("sRGB1", "CAM02-UCS")(rgb) - # Plot colormap L values - # Do separately for each category so each plot can be pretty - # to make scatter markers change color along plot: + # Plot colormap L values. Do separately for each category + # so each plot can be pretty. To make scatter markers change + # color along plot: # http://stackoverflow.com/questions/8202605/matplotlib-scatterplot-colour-as-a-function-of-a-third-variable - if cmap_category=='Perceptually Uniform Sequential': - dc = 1.15 # spacing between colormaps - ax.scatter(x+j*dc, lab[0,:,0], c=x, cmap=cmap, - s=300, linewidths=0.) - if i==2: - ax.axis([-0.1,4.1,0,100]) - else: - ax.axis([-0.1,4.7,0,100]) - locs.append(x[-1]+j*dc) # store locations for colormap labels - - elif cmap_category=='Sequential': - dc = 0.6 # spacing between colormaps + + if cmap_category == 'Sequential': # These colormaps all start at high lightness but we want them # reversed to look nice in the plot, so reverse the order. - ax.scatter(x+j*dc, lab[0,::-1,0], c=x[::-1], cmap=cmap, - s=300, linewidths=0.) - if i==2: - ax.axis([-0.1,4.1,0,100]) - else: - ax.axis([-0.1,4.7,0,100]) - locs.append(x[-1]+j*dc) # store locations for colormap labels - - elif cmap_category=='Sequential (2)': - dc = 1.15 - ax.scatter(x+j*dc, lab[0,:,0], c=x, cmap=cmap, - s=300, linewidths=0.) - ax.axis([-0.1,7.0,0,100]) - # store locations for colormap labels - locs.append(x[-1]+j*dc) - - elif cmap_category=='Diverging': - dc = 1.2 - ax.scatter(x+j*dc, lab[0,:,0], c=x, cmap=cmap, - s=300, linewidths=0.) - ax.axis([-0.1,7.1,0,100]) - # store locations for colormap labels - locs.append(x[int(x.size/2.)]+j*dc) - elif cmap_category=='Qualitative': - dc = 1.3 - ax.scatter(x+j*dc, lab[0,:,0], c=x, cmap=cmap, - s=300, linewidths=0.) - ax.axis([-0.1,6.3,0,100]) - # store locations for colormap labels - locs.append(x[int(x.size/2.)]+j*dc) - - elif cmap_category=='Miscellaneous': - dc = 1.25 - ax.scatter(x+j*dc, lab[0,:,0], c=x, cmap=cmap, - s=300, linewidths=0.) - ax.axis([-0.1,6.1,0,100]) - # store locations for colormap labels - locs.append(x[int(x.size/2.)]+j*dc) - - # Set up labels for colormaps - ax.xaxis.set_ticks_position('top') - ticker = mpl.ticker.FixedLocator(locs) - ax.xaxis.set_major_locator(ticker) - formatter = mpl.ticker.FixedFormatter(cmap_list[i*dsub:(i+1)*dsub]) - ax.xaxis.set_major_formatter(formatter) - labels = ax.get_xticklabels() - for label in labels: - label.set_rotation(60) + y_ = lab[0, ::-1, 0] + c_ = x[::-1] + else: + y_ = lab[0, :, 0] + c_ = x + + dc = _DC.get(cmap_category, 1.2) # cmaps horizontal spacing + ax.scatter(x + j*dc, y_, c=c_, cmap=cmap, s=300, linewidths=0.0) + + # Store locations for colormap labels + if cmap_category in ('Perceptually Uniform Sequential', + 'Sequential', 'Sequential (2)'): + locs.append(x[-1] + j*dc) + elif cmap_category in ('Diverging', 'Qualitative', + 'Miscellaneous'): + locs.append(x[int(x.size/2.)] + j*dc) + + # Set up the axis limits: + # * the 1st subplot is used as a reference for the x-axis limits + # * lightness values goes from 0 to 100 (y-axis limits) + ax.set_xlim(axes[0, 0].get_xlim()) + ax.set_ylim(0.0, 100.0) + + # Set up labels for colormaps + ax.xaxis.set_ticks_position('top') + ticker = mpl.ticker.FixedLocator(locs) + ax.xaxis.set_major_locator(ticker) + formatter = mpl.ticker.FixedFormatter(cmap_list[i*dsub:(i+1)*dsub]) + ax.xaxis.set_major_formatter(formatter) + ax.xaxis.set_tick_params(rotation=50) ax.set_xlabel(cmap_category + ' colormaps', fontsize=14) fig.text(0.0, 0.55, 'Lightness $L^*$', fontsize=12, transform=fig.transFigure, rotation=90) - fig.tight_layout(h_pad=0.05, pad=1.5) + fig.tight_layout(h_pad=0.0, pad=1.5) plt.show() From 3c29961fa9db6396d1fcbfebf149d45bcacdf066 Mon Sep 17 00:00:00 2001 From: "Adrien F. VINCENT" Date: Sat, 25 Mar 2017 12:26:14 +0100 Subject: [PATCH 5/6] Reordering the colormaps and add a few missing ones --- doc/users/plotting/colormaps/colormaps.py | 41 ++++++++++++----------- doc/users/plotting/colormaps/lightness.py | 16 ++++----- examples/color/colormaps_reference.py | 41 ++++++++++++----------- 3 files changed, 50 insertions(+), 48 deletions(-) diff --git a/doc/users/plotting/colormaps/colormaps.py b/doc/users/plotting/colormaps/colormaps.py index 750678b4cdc9..38ed1a312776 100644 --- a/doc/users/plotting/colormaps/colormaps.py +++ b/doc/users/plotting/colormaps/colormaps.py @@ -1,23 +1,24 @@ # Have colormaps separated into categories: # http://matplotlib.org/examples/color/colormaps_reference.html -cmaps = [('Perceptually Uniform Sequential', - ['viridis', 'inferno', 'plasma', 'magma']), - ('Sequential', ['Blues', 'BuGn', 'BuPu', - 'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd', - 'PuBu', 'PuBuGn', 'PuRd', 'Purples', 'RdPu', - 'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd']), - ('Sequential (2)', ['afmhot', 'autumn', 'bone', 'cool', 'copper', - 'gist_heat', 'gray', 'hot', 'pink', 'spring', - 'Wistia', 'summer', 'winter']), - ('Diverging', ['BrBG', 'bwr', 'coolwarm', 'PiYG', 'PRGn', 'PuOr', - 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral', - 'seismic']), - ('Qualitative', ['Accent', 'Dark2', 'Paired', 'Pastel1', - 'Pastel2', 'Set1', 'Set2', 'Set3', 'tab10', - 'tab20', 'tab20b', 'tab20c']), - ('Miscellaneous', ['gist_earth', 'terrain', 'ocean', 'gist_stern', - 'brg', 'CMRmap', 'cubehelix', - 'gnuplot', 'gnuplot2', 'gist_ncar', - 'nipy_spectral', 'jet', 'rainbow', - 'gist_rainbow', 'hsv', 'flag', 'prism'])] +cmaps = [('Perceptually Uniform Sequential', [ + 'viridis', 'plasma', 'inferno', 'magma']), + ('Sequential', [ + 'Greys', 'Purples', 'Blues', 'Greens', 'Oranges', 'Reds', + 'YlOrBr', 'YlOrRd', 'OrRd', 'PuRd', 'RdPu', 'BuPu', + 'GnBu', 'PuBu', 'YlGnBu', 'PuBuGn', 'BuGn', 'YlGn']), + ('Sequential (2)', [ + 'binary', 'gist_yarg', 'gist_gray', 'gray', 'bone', 'pink', + 'spring', 'summer', 'autumn', 'winter', 'cool', 'Wistia', + 'hot', 'afmhot', 'gist_heat', 'copper']), + ('Diverging', [ + 'PiYG', 'PRGn', 'BrBG', 'PuOr', 'RdGy', 'RdBu', + 'RdYlBu', 'RdYlGn', 'Spectral', 'coolwarm', 'bwr', 'seismic']), + ('Qualitative', [ + 'Pastel1', 'Pastel2', 'Paired', 'Accent', + 'Dark2', 'Set1', 'Set2', 'Set3', + 'tab10', 'tab20', 'tab20b', 'tab20c']), + ('Miscellaneous', [ + 'flag', 'prism', 'ocean', 'gist_earth', 'terrain', 'gist_stern', + 'gnuplot', 'gnuplot2', 'CMRmap', 'cubehelix', 'brg', 'hsv', + 'gist_rainbow', 'rainbow', 'jet', 'nipy_spectral', 'gist_ncar'])] diff --git a/doc/users/plotting/colormaps/lightness.py b/doc/users/plotting/colormaps/lightness.py index 8c41e702b7cf..6633632fdf63 100644 --- a/doc/users/plotting/colormaps/lightness.py +++ b/doc/users/plotting/colormaps/lightness.py @@ -17,14 +17,14 @@ mpl.rcParams.update({'font.size': 12}) -# Number of colormap par subplot for particular cmap categories +# Number of colormap per subplot for particular cmap categories _DSUBS = {'Perceptually Uniform Sequential': 4, 'Sequential': 6, - 'Sequential (2)': 5, 'Diverging': 6, 'Qualitative': 4, + 'Sequential (2)': 6, 'Diverging': 6, 'Qualitative': 4, 'Miscellaneous': 6} # Spacing between the colormaps of a subplot -_DC = {'Perceptually Uniform Sequential': 1.15, 'Sequential': 0.6, - 'Sequential (2)': 1.15, 'Diverging': 1.3, 'Qualitative': 1.3, +_DC = {'Perceptually Uniform Sequential': 1.4, 'Sequential': 0.7, + 'Sequential (2)': 1.4, 'Diverging': 1.4, 'Qualitative': 1.4, 'Miscellaneous': 1.4} # Indices to step through colormap @@ -35,7 +35,7 @@ # Do subplots so that colormaps have enough space. # Default is 5 colormaps per subplot. - dsub = _DSUBS.get(cmap_category, 5) + dsub = _DSUBS.get(cmap_category, 6) nsubplots = int(np.ceil(len(cmap_list) / float(dsub))) # squeeze=False to handle similarly the case of a single subplot @@ -67,15 +67,15 @@ y_ = lab[0, :, 0] c_ = x - dc = _DC.get(cmap_category, 1.2) # cmaps horizontal spacing + dc = _DC.get(cmap_category, 1.4) # cmaps horizontal spacing ax.scatter(x + j*dc, y_, c=c_, cmap=cmap, s=300, linewidths=0.0) # Store locations for colormap labels if cmap_category in ('Perceptually Uniform Sequential', - 'Sequential', 'Sequential (2)'): + 'Sequential'): locs.append(x[-1] + j*dc) elif cmap_category in ('Diverging', 'Qualitative', - 'Miscellaneous'): + 'Miscellaneous', 'Sequential (2)'): locs.append(x[int(x.size/2.)] + j*dc) # Set up the axis limits: diff --git a/examples/color/colormaps_reference.py b/examples/color/colormaps_reference.py index 3c37d522208f..7f1add877d3e 100644 --- a/examples/color/colormaps_reference.py +++ b/examples/color/colormaps_reference.py @@ -42,26 +42,27 @@ # Have colormaps separated into categories: # http://matplotlib.org/examples/color/colormaps_reference.html -cmaps = [('Perceptually Uniform Sequential', - ['viridis', 'inferno', 'plasma', 'magma']), - ('Sequential', ['Blues', 'BuGn', 'BuPu', - 'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd', - 'PuBu', 'PuBuGn', 'PuRd', 'Purples', 'RdPu', - 'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd']), - ('Sequential (2)', ['afmhot', 'autumn', 'bone', 'cool', - 'copper', 'gist_heat', 'gray', 'hot', 'pink', - 'spring', 'Wistia', 'summer', 'winter']), - ('Diverging', ['BrBG', 'bwr', 'coolwarm', 'PiYG', 'PRGn', 'PuOr', - 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral', - 'seismic']), - ('Qualitative', ['Accent', 'Dark2', 'Paired', 'Pastel1', - 'Pastel2', 'Set1', 'Set2', 'Set3', 'tab10', - 'tab20', 'tab20b', 'tab20c']), - ('Miscellaneous', ['gist_earth', 'terrain', 'ocean', 'gist_stern', - 'brg', 'CMRmap', 'cubehelix', - 'gnuplot', 'gnuplot2', 'gist_ncar', - 'nipy_spectral', 'jet', 'rainbow', - 'gist_rainbow', 'hsv', 'flag', 'prism'])] +cmaps = [('Perceptually Uniform Sequential', [ + 'viridis', 'plasma', 'inferno', 'magma']), + ('Sequential', [ + 'Greys', 'Purples', 'Blues', 'Greens', 'Oranges', 'Reds', + 'YlOrBr', 'YlOrRd', 'OrRd', 'PuRd', 'RdPu', 'BuPu', + 'GnBu', 'PuBu', 'YlGnBu', 'PuBuGn', 'BuGn', 'YlGn']), + ('Sequential (2)', [ + 'binary', 'gist_yarg', 'gist_gray', 'gray', 'bone', 'pink', + 'spring', 'summer', 'autumn', 'winter', 'cool', 'Wistia', + 'hot', 'afmhot', 'gist_heat', 'copper']), + ('Diverging', [ + 'PiYG', 'PRGn', 'BrBG', 'PuOr', 'RdGy', 'RdBu', + 'RdYlBu', 'RdYlGn', 'Spectral', 'coolwarm', 'bwr', 'seismic']), + ('Qualitative', [ + 'Pastel1', 'Pastel2', 'Paired', 'Accent', + 'Dark2', 'Set1', 'Set2', 'Set3', + 'tab10', 'tab20', 'tab20b', 'tab20c']), + ('Miscellaneous', [ + 'flag', 'prism', 'ocean', 'gist_earth', 'terrain', 'gist_stern', + 'gnuplot', 'gnuplot2', 'CMRmap', 'cubehelix', 'brg', 'hsv', + 'gist_rainbow', 'rainbow', 'jet', 'nipy_spectral', 'gist_ncar'])] nrows = max(len(cmap_list) for cmap_category, cmap_list in cmaps) From e4426472f069ee4c24c03bb0b34cc19c69402c27 Mon Sep 17 00:00:00 2001 From: Adrien F Vincent Date: Mon, 27 Mar 2017 00:03:28 +0200 Subject: [PATCH 6/6] Fix minor typo --- doc/users/plotting/colormaps/lightness.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/users/plotting/colormaps/lightness.py b/doc/users/plotting/colormaps/lightness.py index 6633632fdf63..8addfa6e52b4 100644 --- a/doc/users/plotting/colormaps/lightness.py +++ b/doc/users/plotting/colormaps/lightness.py @@ -34,7 +34,7 @@ for cmap_category, cmap_list in cmaps: # Do subplots so that colormaps have enough space. - # Default is 5 colormaps per subplot. + # Default is 6 colormaps per subplot. dsub = _DSUBS.get(cmap_category, 6) nsubplots = int(np.ceil(len(cmap_list) / float(dsub)))