On Tue, Sep 16, 2008 at 2:40 PM, David Goldsmith <[EMAIL PROTECTED]> wrote: > --- On Tue, 9/9/08, David Goldsmith <[EMAIL PROTECTED]> wrote: > >> eventually ... I'd like to do what John implies >> is possible, i.e., "invert" a cm back to its RGB >> table - John (or anyone) can you short-cut the learning >> process for me w/ a code example of how to do this? :-) >> Thanks! >> >> DG > > No one has a shareable code example of how to invert a colormap to an RGB > array?
Is this what you are looking for? (outputs RGBA but just override the alpha or extract the RGB part) >In [9]: import matplotlib.cm as cm In [10]: x = np.arange(0, 1, 0.1) In [11]: print cm.jet(x) [[ 0. 0. 0.5 1. ] [ 0. 0. 0.9456328 1. ] [ 0. 0.3 1. 1. ] [ 0. 0.69215686 1. 1. ] [ 0.16129032 1. 0.80645161 1. ] [ 0.49019608 1. 0.47754586 1. ] [ 0.80645161 1. 0.16129032 1. ] [ 1. 0.77051561 0. 1. ] [ 1. 0.40740741 0. 1. ] [ 0.9456328 0.02977487 0. 1. ]] ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users