On 08/11/2010 08:54 AM, Friedrich Romstedt wrote:
> 2010/8/11 tgabriel<travisgabri...@gmail.com>:
>> I would like to have the colorbar displaying the same color scaling
>> regardless of the data input.
>
> This /should/ be feasible with .contourf(.., vmin=VMIN, vmax=VMAX),
> but from the doc this isn't clear at least.  If it doesn't work, we
> have to work out how to use the norm=... argument properly to hand
> over a Norm instance.  Please give vmin/max a try, we can look that up
> if it fails.

No, contour* do not use vmin, vmax kwargs. Setting the levels should be 
enough for what I thought the OP wanted to do, so I don't understand the 
problem--hence I requested a standalone script to illustrate it.

vmin, vmax can still be set by using the plt.clim function.

Maybe the OP's problem is that the colors become indistinguishable in 
the relatively small intervals?  If so, the answer is to use a different 
norm, or to use a ListedColormap with a color for each interval.  The 
ListedColormap allows complete freedom to explicitly specify the color 
for each interval between contour boundaries.

>
>> Problem 2: If I have a colorbar scale which goes from -10 to 5, and I use
>> one of the standard colormaps which has white in the center of it. How do I
>> keep the zero point at the white color instead of the colorbar automatically
>> picking the midpoint for zero?
>
> So you want to set the color-MAP's range with the solution to problem
> 1, and display in the color-BAR only a subset of the value range used
> by the Norm?  This has been solved already in a former task, if it
> suits you I can send the sources for that.

This sounds like a job for a custom norm, but maybe you found a better way?

Eric

>
> Friedrich
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to