@@ -6295,8 +6295,7 @@ def table(self, **kwargs):
62956295 def hist (self , x , bins = None , range = None , density = None , weights = None ,
62966296 cumulative = False , bottom = None , histtype = 'bar' , align = 'mid' ,
62976297 orientation = 'vertical' , rwidth = None , log = False ,
6298- color = None , label = None , stacked = False , normed = None ,
6299- ** kwargs ):
6298+ color = None , label = None , stacked = False , ** kwargs ):
63006299 """
63016300 Plot a histogram.
63026301
@@ -6364,30 +6363,26 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
63646363 number of observations. If *stacked* is also ``True``, the sum of
63656364 the histograms is normalized to 1.
63666365
6367- Default is ``None`` for both *normed* and *density*. If either is
6368- set, then that value will be used. If neither are set, then the
6369- args will be treated as ``False``.
6370-
6371- If both *density* and *normed* are set an error is raised.
6366+ Default is ``False``.
63726367
63736368 weights : (n, ) array_like or None, optional
6374- An array of weights, of the same shape as *x*. Each value in *x*
6375- only contributes its associated weight towards the bin count
6376- (instead of 1). If *normed* or * density* is ``True``,
6377- the weights are normalized, so that the integral of the density
6378- over the range remains 1.
6369+ An array of weights, of the same shape as *x*. Each value in
6370+ *x* only contributes its associated weight towards the bin count
6371+ (instead of 1). If *density* is ``True``, the weights are
6372+ normalized, so that the integral of the density over the range
6373+ remains 1.
63796374
63806375 Default is ``None``
63816376
63826377 cumulative : bool, optional
6383- If ``True``, then a histogram is computed where each bin gives the
6384- counts in that bin plus all bins for smaller values. The last bin
6385- gives the total number of datapoints. If *normed* or *density*
6386- is also ``True`` then the histogram is normalized such that the
6387- last bin equals 1. If *cumulative* evaluates to less than 0
6388- (e.g., -1), the direction of accumulation is reversed.
6389- In this case, if *normed* and/or *density* is also ``True``, then
6390- the histogram is normalized such that the first bin equals 1.
6378+ If ``True``, then a histogram is computed where each bin gives
6379+ the counts in that bin plus all bins for smaller values. The last
6380+ bin gives the total number of datapoints. If *density* is also
6381+ ``True`` then the histogram is normalized such that the last bin
6382+ equals 1. If *cumulative* evaluates to less than 0 (e.g., -1), the
6383+ direction of accumulation is reversed. In this case, if *density*
6384+ is also ``True``, then the histogram is normalized such that the
6385+ first bin equals 1.
63916386
63926387 Default is ``False``
63936388
@@ -6467,21 +6462,16 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
64676462
64686463 Default is ``False``
64696464
6470- normed : bool, optional
6471- Deprecated; use the density keyword argument instead.
6472-
64736465 Returns
64746466 -------
64756467 n : array or list of arrays
6476- The values of the histogram bins. See *normed* or *density*
6477- and *weights* for a description of the possible semantics.
6478- If input *x* is an array, then this is an array of length
6479- *nbins*. If input is a sequence of arrays
6480- ``[data1, data2,..]``, then this is a list of arrays with
6481- the values of the histograms for each of the arrays in the
6482- same order. The dtype of the elements of the array *n*
6483- (or of its element arrays) will always be float even if no
6484- weighting or normalization is used.
6468+ The values of the histogram bins. See *density* and *weights* for a
6469+ description of the possible semantics. If input *x* is an array,
6470+ then this is an array of length *nbins*. If input is a sequence of
6471+ arrays ``[data1, data2,..]``, then this is a list of arrays with
6472+ the values of the histograms for each of the arrays in the same
6473+ order. The dtype of the array *n* (or of its element arrays) will
6474+ always be float even if no weighting or normalization is used.
64856475
64866476 bins : array
64876477 The edges of the bins. Length nbins + 1 (nbins left edges and right
@@ -6530,15 +6520,6 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
65306520 if histtype == 'barstacked' and not stacked :
65316521 stacked = True
65326522
6533- if density is not None and normed is not None :
6534- raise ValueError ("kwargs 'density' and 'normed' cannot be used "
6535- "simultaneously. "
6536- "Please only use 'density', since 'normed'"
6537- "is deprecated." )
6538- if normed is not None :
6539- cbook .warn_deprecated ("2.1" , name = "'normed'" , obj_type = "kwarg" ,
6540- alternative = "'density'" , removal = "3.1" )
6541-
65426523 # basic input validation
65436524 input_empty = np .size (x ) == 0
65446525 # Massage 'x' for processing.
@@ -6594,7 +6575,6 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
65946575 xmin = min (xmin , np .nanmin (xi ))
65956576 xmax = max (xmax , np .nanmax (xi ))
65966577 bin_range = (xmin , xmax )
6597- density = bool (density ) or bool (normed )
65986578 if density and not stacked :
65996579 hist_kwargs = dict (range = bin_range , density = density )
66006580 else :
0 commit comments