How to use the colorcet.cm.items function in colorcet

To help you get started, we’ve selected a few colorcet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HCsoft-RD / shaolin / shaolin / dashboards / colormap.py View on Github external
def __init__(self,**kwargs):
        
        # Collapse all colormap aliases into a single string, and then sort by it
        inverse = {}
        inv_rev = {}
        for k,v in cc.cm.items():
            if not k[-2:] == "_r":
                inverse[v] = inverse.get(v, [])
                inverse[v].insert(0,k)
            else:
                inv_rev[v] = inverse.get(v, [])
                inv_rev[v].insert(0,k)
        all_cms = {',  '.join(reversed(v)):k for (k,v) in inverse.items()}.items()
        rev_cms = {',  '.join(reversed(v)):k for (k,v) in inv_rev.items()}.items()
        self._all_cmaps = dict([i for i in all_cms])
        self._rev_cmaps = dict([i for i in rev_cms])
        self._div_cms = dict([i for i in all_cms if "diverging" in i[0]])
        self._iso_cms = dict([i for i in all_cms if "isoluminant" in i[0]])
        self._linear_cms = dict([i for i in all_cms if "linear" in i[0]])
        self._cycle_cms = dict([i for i in all_cms if "cyclic" in i[0]])
        self._alias_cms = dict([(x.split(',')[1].lstrip(' '),v) for x,v in self._all_cmaps.items() if ',' in x])
        control_box = ['c$N=seaborn_palette',