Ryan May wrote:
On Tue, Apr 20, 2010 at 11:40 AM, Jim Vickroy <Jim.Vickroy@noaa.gov> wrote:
Nikolaus Rath wrote:


Maybe my googling skills are deficient, but I wasn't able to find any
information on how to define my own colormap.

Can someone give me a pointer, or a basic example how to create a simple
map that e.g. maps -1 to Red, 0 to White, and 1 to Blue?




That was a tad harsh, given that the first page of google results
didn't really answer the question. (If you're going to be snarky, at
least make sure you're right.)

Nick, this is a pretty good example:


Now, since it seems like you're learning right now, a good place to
look which is better than google is searching matplotlib's docs


I was able to find that example with: codex ListedColormap
(codex tells it to search examples) but that's because I knew the name
of the class I was looking for.

Good luck and don't get discouraged.


I don't know what your Google search results page presented, but the the second entry on the first search results page, for me, was the following:

Cookbook/Matplotlib -
Feb 12, 2010 ... Show colormaps - Small script to display all of the Matplotlib colormaps, and an exampleshowing how to create a new one. ...
www.scipy.org/Cookbook/Matplotlib - Cached

-- jv