sidpy/viz/plot_utils/cmap.py
def discrete_cmap(num_bins, cmap=None):
    """
    Create an N-bin discrete colormap from the specified input map specified

    Parameters
    ----------
    num_bins : unsigned int
        Number of discrete bins
    cmap : matplotlib.colors.Colormap object
        Base color map to discretize

    Returns
    -------
    new_cmap : matplotlib.colors.LinearSegmentedColormap object
        Discretized color map

    Notes
    -----
    Jake VanderPlas License: BSD-style
    https://gist.github.com/jakevdp/91077b0cae40f8f8244a

    """
    if cmap is None:
        cmap = default_cmap.name

    elif isinstance(cmap, mpl.colors.Colormap):
        cmap = cmap.name
    elif not isinstance(cmap, (str, unicode)):
        raise TypeError('cmap should be a string or a matplotlib.colors.Colormap object')

    if not isinstance(num_bins, int):
        raise TypeError('num_bins must be an unsigned integer')

    return plt.get_cmap(cmap, num_bins)

    Create an N-bin discrete colormap from the specified input map specified

    Parameters
    ----------
    num_bins : unsigned int
        Number of discrete bins
    cmap : matplotlib.colors.Colormap object
        Base color map to discretize

    Returns
    -------
    new_cmap : matplotlib.colors.LinearSegmentedColormap object
        Discretized color map

    Notes
    -----
    Jake VanderPlas License: BSD-style
    https://gist.github.com/jakevdp/91077b0cae40f8f8244a

    
Create an N-bin discrete colormap from the specified input map specified
Parameters

num_bins : unsigned int
Number of discrete bins
cmap : matplotlib.colors.Colormap object
Base color map to discretize

Returns

new_cmap : matplotlib.colors.LinearSegmentedColormap object
Discretized color map

Notes


Create an N - bin discrete colormap from the specified input map specified Parameters num_bins : unsigned int Number of discrete bins cmap : matplotlib . colors . Colormap object Base color map to discretize Returns new_cmap : matplotlib . colors . LinearSegmentedColormap object Discretized color map Notes
def discrete_cmap(num_bins, cmap=None):
    if cmap is None:
        cmap = default_cmap.name
    elif isinstance(cmap, mpl.colors.Colormap):
        cmap = cmap.name
    elif not isinstance(cmap, (str, unicode)):
        raise TypeError('cmap should be a string or a matplotlib.colors.Colormap object')
    if not isinstance(num_bins, int):
        raise TypeError('num_bins must be an unsigned integer')
    return plt.get_cmap(cmap, num_bins)
def discrete_cmap ( num_bins , cmap = None ) : if cmap is None : cmap = default_cmap . name elif isinstance ( cmap , mpl . colors . Colormap ) : cmap = cmap . name elif not isinstance ( cmap , ( str , unicode ) ) : raise TypeError ( 'cmap should be a string or a matplotlib.colors.Colormap object' ) if not isinstance ( num_bins , int ) : raise TypeError ( 'num_bins must be an unsigned integer' ) return plt . get_cmap ( cmap , num_bins )
Create an N-bin discrete colormap from the specified input map specified
Parameters
Create an N - bin discrete colormap from the specified input map specified Parameters
"""
    Create an N-bin discrete colormap from the specified input map specified

    Parameters
    ----------
    num_bins : unsigned int
        Number of discrete bins
    cmap : matplotlib.colors.Colormap object
        Base color map to discretize

    Returns
    -------
    new_cmap : matplotlib.colors.LinearSegmentedColormap object
        Discretized color map

    Notes
    -----
    Jake VanderPlas License: BSD-style
    https://gist.github.com/jakevdp/91077b0cae40f8f8244a

    """
num_bins
cmap