Hi Tony,

thanks! the first one works but not lambda x : 1-x. The function might be useful while it needs a little bit knowledge of colors.

cheers,

Chao

2012/3/29 Tony Yu <tsyu80@gmail.com>


On Thu, Mar 29, 2012 at 1:31 PM, Chao YUE <chaoyuejoy@gmail.com> wrote:
Dear all,

here in cookbook it says "Ever wanted to reverse a colormap, or to desaturate one ? Here is a routine to apply a function to the look up table of a colormap: "
http://www.scipy.org/Cookbook/Matplotlib/ColormapTransformations

but I don't know how to use cmap_map function as in the link to reverse, for example, the cm.jet colormap?


If all you want is the reversed colormap, you can call `cm.jet_r` (all the default colormaps have a `_r` version). From a *quick* look at the example you link to, it seems that you can pass `lambda x: 1 - x` as the function to `cmap_xmap`.

Cheers,
-Tony

(Chao: Sorry for the duplicate. Forgot to reply-all)


thanks,

Chao
--
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users





--
***********************************************************************************
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
************************************************************************************