Example #1
0
def algae(range, **traits):
    _data = {
        'red': ((0.0, 80 / 256., 80 / 256.), (0.2, 0.0, 0.0), (0.4, 0.0, 0.0),
                (0.6, 256 / 256., 256 / 256.), (0.95, 256 / 256., 256 / 256.),
                (1.0, 150 / 256., 150 / 256.)),
        'green': ((0.0, 0 / 256., 0 / 256.), (0.2, 0 / 256., 0 / 256.),
                  (0.4, 130 / 256., 130 / 256.), (0.6, 256 / 256., 256 / 256.),
                  (1.0, 0.0, 0.0)),
        'blue': ((0.0, 80 / 256., 80 / 256.), (0.2, 220 / 256., 220 / 256.),
                 (0.4, 0.0, 0.0), (0.6, 20 / 256., 20 / 256.), (1.0, 0.0, 0.0))
    }
    return ColorMapper.from_segment_map(_data, range=range, **traits)
def algae(range, **traits):
    _data = {'red':   ((0.0, 80/256., 80/256.),
                       (0.2, 0.0, 0.0),
                       (0.4, 0.0, 0.0),
                       (0.6, 256/256., 256/256.),
                       (0.95, 256/256., 256/256.),
                       (1.0, 150/256., 150/256.)),
             'green': ((0.0, 0/256., 0/256.),
                       (0.2, 0/256., 0/256.),
                       (0.4, 130/256., 130/256.),
                       (0.6, 256/256., 256/256.),
                       (1.0, 0.0, 0.0)),
             'blue':  ((0.0, 80/256., 80/256.),
                       (0.2, 220/256., 220/256.),
                       (0.4, 0.0, 0.0),
                       (0.6, 20/256., 20/256.),
                       (1.0, 0.0, 0.0))}
    return ColorMapper.from_segment_map(_data, range=range, **traits)
Example #3
0
def _cmap(range, **traits):
    _data =   {'red':   ((0,1,1), (0.3, .8, .8), (0.5, 0, 0), (0.75,0.75, 0.75),(.875,.2,.2),
                         (1, 0, 0)),
               'blue': ((0., 0, 0), (0.3,0, 0), (0.5,0, 0), (0.75,.75, .75),
                         (0.875,0.75,0.75), (1, 1, 1)),
               'green':  ((0.,0, 0),(0.3,.8,.8), (0.4, 0.4, 0.4),(0.5,1,1), (0.65,.75, .75), (0.75,0.1, 0.1),
                         (1, 0, 0))}

#    """ inverted version of 'jet' colormap"""

#    _data =   {'red':   ((0., 0, 0), (0.35, 0, 0), (0.66, 1, 1), (0.89,1, 1),
#                         (1, 0.5, 0.5)),
#               'green': ((0., 0, 0), (0.125,0, 0), (0.375,1, 1), (0.64,1, 1),
#                         (0.91,0,0), (1, 0, 0)),
#               'blue':  ((0., 0.5, 0.5), (0.11, 1, 1), (0.34, 1, 1), (0.65,0, 0),
#                         (1, 0, 0))}
#    for k,v in _data.items():
#        _data[k] = tuple(reversed([(v[-1-i][0],t[1],t[2]) for i,t in enumerate(v)]))
#
    return ColorMapper.from_segment_map(_data, range=range, **traits)
Example #4
0
def _cmap(range, **traits):
    _data =   {'red':   ((0,1,1), (0.3, .8, .8), (0.5, 0, 0), (0.75,0.75, 0.75),(.875,.2,.2),
                         (1, 0, 0)),
               'blue': ((0., 0, 0), (0.3,0, 0), (0.5,0, 0), (0.75,.75, .75),
                         (0.875,0.75,0.75), (1, 1, 1)),
               'green':  ((0.,0, 0),(0.3,.8,.8), (0.4, 0.4, 0.4),(0.5,1,1), (0.65,.75, .75), (0.75,0.1, 0.1),
                         (1, 0, 0))}

#    """ inverted version of 'jet' colormap"""

#    _data =   {'red':   ((0., 0, 0), (0.35, 0, 0), (0.66, 1, 1), (0.89,1, 1),
#                         (1, 0.5, 0.5)),
#               'green': ((0., 0, 0), (0.125,0, 0), (0.375,1, 1), (0.64,1, 1),
#                         (0.91,0,0), (1, 0, 0)),
#               'blue':  ((0., 0.5, 0.5), (0.11, 1, 1), (0.34, 1, 1), (0.65,0, 0),
#                         (1, 0, 0))}
#    for k,v in _data.items():
#        _data[k] = tuple(reversed([(v[-1-i][0],t[1],t[2]) for i,t in enumerate(v)]))
#
    return ColorMapper.from_segment_map(_data, range=range, **traits)
Example #5
0
    def default_cmap( self, range, **traits ):

        """ Default colormap for brain slice plots """

        vrange = ( -256, 256 )

        _data = {'red':   ((0,    0,   0),
                           (0,    0,   0),
                           (0.5,  0.1, 0.1),
                           (0.85, 1.0, 1.0),
                           (1.0,  1.0, 1.0)),
                 'green': ((0,    1,    1),
                           (0.15, 0.5,  0.5),
                           (0.5,  0.,   0.),
                           (0.7,  0.,   0.),
                           (0.85, 0.85, 0.85),
                           (1.0,  1.0,  1.0)),
                 'blue':  ((0,    1,    1),
                           (0.40, 0.5,  0.5), 
                           (0.5,  0,    0),
                           (0.85, 0.,   0.),
                           (1.0,  1.,  1.)),
                 'alpha': ((0.,   1.,   1.), 
                           (0.4,  1.,   1.),
                           (0.495,0.,   0.),
                           (0.5,  0.,   0.),
                           (0.505,0.,   0.),
                           (0.6,  1.,  1.),
                           (1.0,  1.,  1.)) }

        cm = ColorMapper.from_segment_map( _data, range = range, **traits )        

        cm.low  = vrange[0]
        cm.high = vrange[1]

        return cm
def make_color_map():
    return ColorMapper.from_palette_array(palette11, range=DataRange1D(low=0, high=10))