Wednesday, March 7, 2007

non-linear colormaps in matplotlib

Here is a way to do non-linear colormaps in matplotlib. You can select a base colormap, and a series of levels, and this class will remap the (linear) colormap such that your new selected levels define the linear positions along the map. This can be used for plotting bathymetry, specifically, where you may want to have more contours in the shallows than deep. Grab the code here: nlcmap.py.

No comments:

Post a Comment