Inherits from
- AbstractColormap: enthought.chaco.abstract_colormap.AbstractColormap
Attributes
- color_bands
The color table.
color_bands = Property(Array)
- high_pos
Not used.
high_pos = None
- low_pos
Not used.
low_pos = None
- name
The name of this color map.
name = Str
- steps
The total number of color steps in the map.
steps = Int(256)
- updated
A generic "update" event that generally means that anything that relies on this mapper for visual output should do a redraw or repaint.
updated = Event
Inherited from base classes
Method summary
- __init__(self, segmentdata, **kwtraits)
- from_file(cls, filename, **traits)
- from_palette_array(cls, palette, **traits)
- from_segment_map(cls, segment_map, **traits)
- map_index(self, ary)
- map_screen(self, data_array)
- reverse_colormap(self)
Inherited from base classes
- __deepcopy__(self, memo)
- __getstate__(self)
- __prefix_trait__(self, name, is_set)
- __reduce_ex__(self, protocol)
- __setstate__(self, state, trait_change_notify = True)
- add_class_trait(cls, name, *trait)
- add_trait(self, name, *trait)
- add_trait_category(cls, category)
- add_trait_listener(self, object, prefix = '')
- all_trait_names(self)
- base_trait(self, name)
- class_default_traits_view(cls)
- class_editable_traits(cls)
- class_trait_names(cls, **metadata)
- class_trait_view(cls, name = None, view_element = None)
- class_trait_view_elements(cls)
- class_traits(cls, **metadata)
- clone_traits(self, traits = None, memo = None, copy = None, **metadata)
- configure_traits(self, filename = None, view = None, kind = None, edit = True, context = None, handler = None, id = '', scrollable = None, **args)
- copy_traits(self, other, traits = None, memo = None, copy = None, **metadata)
- copyable_trait_names(self, **metadata)
- default_traits_view(self)
- edit_traits(self, view = None, parent = None, kind = None, context = None, handler = None, id = '', scrollable = None, **args)
- editable_traits(self)
- has_traits_interface(self, *interfaces)
- on_trait_change(self, handler, name = None, remove = False, dispatch = 'same', priority = False, deferred = False)
- print_traits(self, show_help = False, **metadata)
- remove_trait(self, name)
- remove_trait_listener(self, object, prefix = '')
- reset_traits(self, traits = None, **metadata)
- set_trait_dispatch_handler(cls, name, klass, override = False)
- sync_trait(self, trait_name, object, alias = None, mutual = True, remove = False)
- trait(self, name, force = False, copy = False)
- trait_context(self)
- trait_get(self, *names, **metadata)
- trait_monitor(cls, handler, remove = False)
- trait_names(self, **metadata)
- trait_set(self, trait_change_notify = True, **traits)
- trait_setq(self, **traits)
- trait_subclasses(cls, all = False)
- trait_view(self, name = None, view_element = None)
- trait_view_elements(self)
- trait_views(self, klass = None)
- traits(self, **metadata)
- validate_trait(self, name, value)
Methods
- __init__(self, segmentdata, **kwtraits)
Creates a Colormapper from a segment map.
The segment_map parameter is a dictionary with 'red', 'green', and 'blue' (and optionally 'alpha') entries. Each entry is a list of (x, y0, y1) tuples:
- x: an offset in [0..1] (offsets within the list must be in ascending order)
- y0: value for the color channel for values less than or equal to x
- y1: value for the color channel for values greater than x
When a data value gets mapped to a color, it will be normalized to be within [0..1]. For each RGB(A) component, the two adjacent values will be found in the segment_map. The mapped component value will be found by linearly interpolating the two values.
Generally, y0==y1. Colormaps with sharp transitions will have y0!=y1 at the transitions.
- from_file(cls, filename, **traits)
Creates a ColorMapper from a file.
The filename parameter is the name of a file whose lines each contain 4 or 5 float values between 0.0 and 1.0. The first value is an offset in the range [0..1], and the remaining 3 or 4 values are red, green, blue, and optionally alpha values for the color corresponding to that offset.
The first line is assumed to contain the name of the colormap.
- from_palette_array(cls, palette, **traits)
Creates a ColorMapper from a palette array.
The palette colors are linearly interpolated across the range of mapped values.
The palette parameter is a Nx3 or Nx4 array of intensity values, where N > 1:
[[R0, G0, B0], ... [R(N-1), G(N-1), B(N-1)]] [[R0, G0, B0, A0], ... [R(N-1), G(N-1), B(N-1), A(N-1]]
- from_segment_map(cls, segment_map, **traits)
Creates a Colormapper from a segment map.
The segment_map parameter is a dictionary with 'red', 'green', and 'blue' (and optionally 'alpha') entries. Each entry is a list of (x, y0, y1) tuples:
- x: an offset in [0..1] (offsets within the list must be in ascending order)
- y0: value for the color channel for values less than or equal to x
- y1: value for the color channel for values greater than x
When a data value gets mapped to a color, it will be normalized to be within [0..1]. For each RGB(A) component, the two adjacent values will be found in the segment_map. The mapped component value will be found by linearly interpolating the two values.
Generally, y0==y1. Colormaps with sharp transitions will have y0!=y1 at the transitions.
- map_index(self, ary)
Maps an array of values to their corresponding color band index.
- map_screen(self, data_array)
Maps an array of data values to an array of colors.
- reverse_colormap(self)
Reverses the color bands of this colormap.