Minor fix to histogram weights (patch attached)

I noticed a small problem in axes.py; when setting weights with a
histogram, a variable 'w' is accessed before it's assigned. It looks
like this is a typo where 'w' should instead be 'weights'. The patch
is copied below and attached.

Cheers,
Jeff

Jeff Klukas, Research Assistant, Physics
University of Wisconsin -- Madison
jeff.klukas@...830... | jeffyklukas@...831... | jeffklukas@...832...
http://www.hep.wisc.edu/~jklukas/

Index: lib/matplotlib/axes.py

klukashist.diff (514 Bytes)

···

===================================================================
--- lib/matplotlib/axes.py (revision 8316)
+++ lib/matplotlib/axes.py (working copy)
@@ -7364,7 +7364,7 @@
                 raise ValueError("color kwarg must have one color per dataset")

         if weights is not None:
- if isinstance(w, np.ndarray):
+ if isinstance(weights, np.ndarray):
                 w = np.array(weights)
                 if w.ndim == 2:
                     w = w.T

I noticed a small problem in axes.py; when setting weights with a
histogram, a variable 'w' is accessed before it's assigned. It looks
like this is a typo where 'w' should instead be 'weights'. The patch
is copied below and attached.

Fixed in 8317--thanks very much!

Eric

···

On 05/17/2010 07:12 AM, Jeff Klukas wrote:

Cheers,
Jeff

>> Jeff Klukas, Research Assistant, Physics
>> University of Wisconsin -- Madison
>> jeff.klukas@...830... | jeffyklukas@...831... | jeffklukas@...832...
>> http://www.hep.wisc.edu/~jklukas/

Index: lib/matplotlib/axes.py

--- lib/matplotlib/axes.py (revision 8316)
+++ lib/matplotlib/axes.py (working copy)
@@ -7364,7 +7364,7 @@
                  raise ValueError("color kwarg must have one color per dataset")

          if weights is not None:
- if isinstance(w, np.ndarray):
+ if isinstance(weights, np.ndarray):
                  w = np.array(weights)
                  if w.ndim == 2:
                      w = w.T

------------------------------------------------------------------------------

_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
matplotlib-devel List Signup and Options