2008/11/21 Eric Firing <[EMAIL PROTECTED]>:
> Michael Outhouse wrote:
>> I was wondering if it is possible to change the colorbar tick labeling in
>> matplotlib from numeric to text. Essentially, I want the colorbar to be a
>> qualitative indicator; in the jet scheme, I'd like blue to be labeled
>> as 'unstable', green as 'neutral', and red as 'stable'. I can change it so I
>> just show the underlying values - colorbar(ticks = (-1, 0, 1)), but I cannot
>> change the the tick labels to text. Is there any way to accomplish this?
>> Thanks in advance for any help.
>
> Your message came more than a month ago, but it looks like no one
> answered, so here is an answer:
>
> with ipython -pylab:
>
> imshow(2*rand(10,10) - 1, vmin=-1, vmax=1)
> cbar = colorbar(ticks=[-1,0,1])
> cbar.ax.set_yticklabels(['unstable', 'neutral', 'stable'])
> draw()

Also see the example here
http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html.

Cheers,
Scott

-------------------------------------------------------------------------
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