Hi all,

Does anyone know of a good way to create a new LinearSegmentedColormap based
off an existing one?

I have a function which attempts to generate N "optimal" color map indices
for a given data array. In cases where the number of values specified
in _segmentdata is the same as N, then I can simply copy _segmentdata and
modify the indices and create a new color map. In many cases, however, the
segment data has far fewer interpolation points, e.g.:

In [52]: cm.gray._segmentdata
Out[52]:
{'blue': ((0.0, 0, 0), (1.0, 1, 1)),
 'green': ((0.0, 0, 0), (1.0, 1, 1)),
 'red': ((0.0, 0, 0), (1.0, 1, 1))}


Other colormaps may have an arbitrary number of interpolation points.
Ideally, what I would like is a way to expand this into N points (e.g. 256)
so that I use that as input for my new map.

Any suggestions? I found a similar
post<http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTik0v7nh4NB1rOBCP_dFQfS2JJoe0S6NeUrw0p6k%40mail.gmail.com&forum_name=matplotlib-users>from
last year, but that doesn't seem to be applicable in the version of
Matplotlib I'm using (1.1.0).

Thanks,
Keith
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to