That works just great. thanks a lot.

On Sat, Jul 26, 2008 at 1:49 PM, Eric Firing <[EMAIL PROTECTED]> wrote:

>  Bharathkrishna wrote:
>
>> By default the colorbar has 0 for black and 1 for white. I was wondering
>> if it is possible to reverse this for it show 0 for white and move upwords
>> to show 1 for black.
>> regards,
>> kbk
>>
>
> It sounds like what you are asking for is a reversed colormap, and all the
> standard colormaps included with mpl have reversed forms.  The pylab
> interface does not provide functions for the reversed forms, but it does
> allow one to specify any of the reversed forms.  To use a reversed gray
> colormap, for example, one might do something like this:
>
> import matplotlib.pyplot as plt
> import numpy as np
>
> img = plt.imshow(np.random.rand(10, 12))
> img.set_cmap(plt.cm.gray_r)
> plt.colorbar()
> plt.show()
>
> Eric
>
-------------------------------------------------------------------------
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

Reply via email to