Revision: 8595 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8595&view=rev Author: weathergod Date: 2010-07-29 21:55:52 +0000 (Thu, 29 Jul 2010)
Log Message: ----------- Fix inconsistency with the handling of the 'weights' keyword and input data for hist(). Modified Paths: -------------- branches/v1_0_maint/lib/matplotlib/axes.py Modified: branches/v1_0_maint/lib/matplotlib/axes.py =================================================================== --- branches/v1_0_maint/lib/matplotlib/axes.py 2010-07-29 16:22:53 UTC (rev 8594) +++ branches/v1_0_maint/lib/matplotlib/axes.py 2010-07-29 21:55:52 UTC (rev 8595) @@ -7551,6 +7551,8 @@ 'hist now uses the rwidth to give relative width ' 'and not absolute width') + # Massage 'x' for processing. + # NOTE: Be sure any changes here is also done below to 'weights' if isinstance(x, np.ndarray) or not iterable(x[0]): # TODO: support masked arrays; x = np.asarray(x) @@ -7577,8 +7579,9 @@ if len(color) != nx: raise ValueError("color kwarg must have one color per dataset") + # We need to do to 'weights' what was done to 'x' if weights is not None: - if isinstance(weights, np.ndarray): + if isinstance(weights, np.ndarray) or not iterable(weights[0]) : w = np.array(weights) if w.ndim == 2: w = w.T This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ Matplotlib-checkins mailing list Matplotlib-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins