On 2012/07/28 10:17 PM, Jeffrey Spencer wrote:
> Think I figured out an actual bug in the function: colors.Normalize().
>
> The behavior states that if vmin or vmax is passed in as None it should
> take the minimum or maximum value respectively.
>
> If only one value is passed into the function, both values are
> overwritten to the min and max instead of just the one that is not
> passed in. So the only case where it sets the limits is if both vmin and
> vmax are passed to the function. Is this the desired behavior because
> from the docstring it seems this is incorrect.
>
> Cheers,
> Jeff
>
>
Jeff,
I don't see it, so you need to provide an actual example. Here is what
happens (in ipython --pylab) when I try to reproduce what it sounds like
you are describing:
In [2]: norm = Normalize(vmax=10)
In [3]: norm([-10, 10, 20])
Out[3]:
masked_array(data = [ 0. 1. 1.5],
mask = False,
fill_value = 1e+20)
In [4]: norm.vmin
Out[4]: -10.0
In [5]: norm.vmax
Out[5]: 10
This behavior is as described in the docstring.
The one potentially confusing aspect that I see at the moment is that
the Normalize class does not distinguish between explicit vmin, vmax,
and the values that it calculates via its autoscale_None method when
called. As soon as a None is replaced by an actual value, whether by
being set explicitly or by autoscaling, the replacement is permanent.
Perhaps this should be made explicit in the docstring. The docstrings
could be re-arranged to clarify the roles of the class initializer and
its __call__ method.
Eric
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users