eelbrain.plot.colors_for_oneway

eelbrain.plot.colors_for_oneway(cells, hue_start=0.2, light_range=0.5, cmap=None, light_cycle=None, always_cycle_hue=False, locations=None)

Define colors for a single factor design

Parameters:
cells : sequence of str

Cells for which to assign colors.

hue_start : 0 <= scalar < 1 | sequence of scalar

First hue value (default 0.2) or list of hue values.

light_range : scalar | tuple of 2 scalar

Scalar that specifies the amount of lightness variation (default 0.5). If positive, the first color is lightest; if negative, the first color is darkest. A tuple can be used to specify exact end-points (e.g., (1.0, 0.4)). 0.2 is equivalent to (0.4, 0.6). The light_cycle parameter can be used to cycle between light and dark more than once.

cmap : str

Use a matplotlib colormap instead of the default color generation algorithm. Name of a matplotlib colormap to use (e.g., ‘jet’). If specified, hue_start and light_range are ignored.

light_cycle : int

Cycle from light to dark in light_cycle cells to make nearby colors more distinct (default cycles once).

always_cycle_hue : bool

Cycle hue even when cycling lightness. With False (default), hue is constant within a lightness cycle.

locations : sequence of float

Locations of the cells on the color-map (all in range [0, 1]; default is evenly spaced; example: numpy.linspace(0, 1, len(cells)) ** 0.5).

Returns:
dict : {str: tuple}

Mapping from cells to colors.