stuartornum wrote:
> Hi All,
>
> You may remember from my previous post I was having problems plotting a
> heatmap, however Pete came through for me and made it work.
>
> Anyway, I have almost finished what I want to do. The only issue is fixing
> the colorbar() range limit.
>
> Sometimes the my values are 0.01 to 0.2 for example, and other times there
> 0.01 to 0.99.
>
> So what happens it the colorbar() automagically adjusts the gradient
> according to my values, however I do not want it to do that, I want the
> graph to be consistantly 0 - 1 (blue - red).
>
> I have tried things like colorbar(0,1), however no luck.
>
> If you could let me know how to fix the range, I would be very grateful.
>
> Regards
>   
Stuart:  Use the vmin/vmax keyword arguments if your are using imshow or 
pcolor/pcolormesh.  If you are using contourf,  just specify the contour 
levels to span the range 0-1 (i.e. clevs=linspace(-1,1,15)).

-Jeff

-- 
Jeffrey S. Whitaker         Phone : (303)497-6313
NOAA/OAR/CDC  R/PSD1        FAX   : (303)497-6449
325 Broadway                Boulder, CO, USA 80305-3328


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