chaco.abstract_colormap module

Defines the base class for color maps

class chaco.abstract_colormap.AbstractColormap

Bases: traits.has_traits.HasTraits

Abstract class for color maps, which map from scalar values to color values.

color_depth = Enum("rgba", "rgb")

The color depth of the colors to use.

map_data(ary)color_array

Returns an array of values containing the colors mapping to the values in ary. If the input array is NxM, the returned array is NxMx3 or NxMx4, depending on the color_depth setting.

map_index(ary)index into color_bands

This method is like map_screen(), but it returns an array of indices into the color map’s color bands instead of an array of colors. If the input array is NxM, then the output is NxM integer indices.

This method might not apply to all color maps. Ones that cannot define a static set of color bands (e.g., function-defined color maps) are not able to implement this function.

map_screen(val)color

Maps an array of values to an array of colors. If the input array is NxM, the returned array is NxMx3 or NxMx4, depending on the color_depth setting.

map_uint8(val)rgb24 or rgba32 color

Maps a single value to a single color. Color is represented as either length-3 or length-4 array of rgb(a) uint8 values, depending on the color_depth setting.

range = Instance(DataRange1D)

The data-space bounds of the mapper.

updated = Event

A generic “update” event that generally means that anything that relies on this mapper for visual output should do a redraw or repaint.