[SciPy-user] colormap model

Peter Wang pwang at enthought.com
Tue Aug 21 12:12:32 EDT 2007


On Aug 21, 2007, at 10:20 AM, Michael Hearne wrote:

> Is there any documentation anywhere for matplotlib's colormap  
> model?  I'm confused, for example, by the "jet" entry in _cm.py:
>
> Why are there 5 tuples describing red and blue, but 6 describing  
> green?
>
> I'd like to create my own colormaps, but I'm uncertain what the  
> data describing the existing ones actually means.

These are documented in the docstrings for makeMappingArray  
(colors.py:332) and in Colormap.__call__ (colors.py:409).

Basically each color channel (red, green, blue) has its own set of  
linearly interpolated segments, with control points spanning the  
range (0.0, 1.0).  In the case of LinearSegmentedColormap, these  
control points are used to build a 256-entry table with an RGB color  
in each row.


-Peter



More information about the SciPy-User mailing list