After experimenting with colormaps for a while, I was able to make both
discrete (piecewise-constant) and continuous (piecewise-linear) colormaps
work. Although colormaps can be created directly using
LinearSegmentedColormap from the matplotlib.colors package, this is a
tedious and error-prone process. So, I compiled a set of three interface
functions. (I wrote two of these myself, and got one from the SciPy
website). The two functions that I wrote permit one to define a discrete
(piecewise-constant) and continuous (piecewise-linear) colormap directly via
a sequence of colors and a set of thresholds specified as lists. Each color
may be specified either via an RGB tuple or via an English color name known
to webcolors.name_to_rgb. I'm going to submit all of this to the matplotlib
developers forums in the hopes of getting it incorporated into matplotlib.
View this message in context: http://www.nabble.com/new-interface-functions-for-LinearSegmentedColormap-tp25657187p25657187.html
Sent from the matplotlib - users mailing list archive at Nabble.com.