From: <mme...@us...> - 2008-06-09 12:13:49
|
Revision: 5430 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5430&view=rev Author: mmetz_bn Date: 2008-06-09 05:13:20 -0700 (Mon, 09 Jun 2008) Log Message: ----------- Added range keyword arg to hist() Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-06-09 07:22:56 UTC (rev 5429) +++ trunk/matplotlib/CHANGELOG 2008-06-09 12:13:20 UTC (rev 5430) @@ -1,4 +1,6 @@ -2008=06-07 Moved list of backends to rcsetup.py; made use of lower +2008-06-09 Added range keyword arg to hist() - MM + +2008-06-07 Moved list of backends to rcsetup.py; made use of lower case for backend names consistent; use validate_backend when importing backends subpackage - EF Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-09 07:22:56 UTC (rev 5429) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-09 12:13:20 UTC (rev 5430) @@ -5649,7 +5649,7 @@ #### Data analysis - def hist(self, x, bins=10, normed=False, cumulative=False, + def hist(self, x, bins=10, range=None, normed=False, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, **kwargs): """ @@ -5669,6 +5669,10 @@ either an integer number of bins or a sequence giving the bins. x are the data to be binned. x can be an array or a 2D array with multiple data in its columns. + + range: + The lower and upper range of the bins. Lower and upper outliers + are ignored. If not provided, range is (x.min(), x.max()). normed: if True, the first element of the return tuple will @@ -5742,11 +5746,11 @@ for i in xrange(x.shape[1]): # this will automatically overwrite bins, # so that each histogram uses the same bins - m, bins = np.histogram(x[:,i], bins, range=None, + m, bins = np.histogram(x[:,i], bins, range=range, normed=bool(normed), new=True) n.append(m) else: - n, bins = np.histogram(x, bins, range=None, + n, bins = np.histogram(x, bins, range=range, normed=bool(normed), new=True) n = [n,] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |