From d6eb4f418fd0e7cbf62044334732f19d49bc3a16 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Thu, 30 Nov 2017 11:12:29 +0000 Subject: [PATCH 1/2] Deprecate 'normed' kwarg to hist --- lib/matplotlib/axes/_axes.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index f706db64d159..58498b1e1a24 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -6051,6 +6051,9 @@ def hist(self, x, bins=None, range=None, density=None, weights=None, Default is ``False`` + normed : bool, optional + Deprecated; use the density keyword argument instead. + Returns ------- n : array or list of arrays @@ -6108,11 +6111,14 @@ def hist(self, x, bins=None, range=None, density=None, weights=None, if histtype == 'barstacked' and not stacked: stacked = True + if normed is not None: + warnings.warm("The 'normed' kwarg is deprecated, and has been " + "replaced by the 'density' kwarg.") if density is not None and normed is not None: raise ValueError("kwargs 'density' and 'normed' cannot be used " "simultaneously. " "Please only use 'density', since 'normed'" - "will be deprecated.") + "is deprecated.") # basic input validation input_empty = np.size(x) == 0 From e247383b290b759abdaa5babb14fffae6872bb42 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Thu, 30 Nov 2017 11:26:49 +0000 Subject: [PATCH 2/2] Fix warning --- lib/matplotlib/axes/_axes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 58498b1e1a24..5d05169728aa 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -6112,7 +6112,7 @@ def hist(self, x, bins=None, range=None, density=None, weights=None, stacked = True if normed is not None: - warnings.warm("The 'normed' kwarg is deprecated, and has been " + warnings.warn("The 'normed' kwarg is deprecated, and has been " "replaced by the 'density' kwarg.") if density is not None and normed is not None: raise ValueError("kwargs 'density' and 'normed' cannot be used "