eelbrain.plot.two_step_colormap(left_max, left, center='transparent', right=None, right_max=None, name='two-step')

Colormap using lightness to extend range

left_max : matplotlib color

Left end of the colormap.

left : matplotlib color

Left middle of the colormap.

center : matplotlib color | ‘transparent’

Color for the middle value; ‘transparent to make the middle transparent (default).

right : matplotlib color

Right middle of the colormap (if not specified, tyhe colormap ends at the location specified by center).

right_max : matplotlib color

Right end of the colormap.

name : str

Name for the colormap.


Standard red/blue:

>>> cmap = plot.two_step_colormap('black', 'red', 'transparent', 'blue', 'black', name='red-blue')
>>> plot.ColorBar(cmap, 1)

Or somewhat more adventurous:

>>> cmap = plot.two_step_colormap('black', (1, 0, 0.3), 'transparent', (0.3, 0, 1), 'black', name='red-blue-2')