I have a series of lines, each of which must be built with a separate color. Each line actually consists of several data sets (positive, negative areas, etc.), and therefore I would like to be able to create a generator that will give one color at a time over the spectrum, for example, the gist_rainbow map gist_rainbow shown here .
I found the following works, but it seems very complicated and, more importantly, itβs hard to remember,
from pylab import * NUM_COLORS = 22 mp = cm.datad['gist_rainbow'] get_color = matplotlib.colors.LinearSegmentedColormap.from_list(mp, colors=['r', 'b'], N=NUM_COLORS) ...
In addition, it does not cover the range of colors on the gist_rainbow map, I have to redefine the map.
Maybe the generator is not the best way to do this, if so, then what is accepted?
python matplotlib color-mapping
Brendan Jun 10 '10 at 16:18 2010-06-10 16:18
source share