From d8b7eacb3734789fe7e8448772e20edb355e7b14 Mon Sep 17 00:00:00 2001 From: Rodrigo Tobar Date: Tue, 12 Sep 2023 11:43:52 +0800 Subject: [PATCH] Prefer histogram's "density" argument over "normed" The latter has been deprecated since numpy 1.6, and effectively removed in the latest versions of numpy. The "density" argument has equivalent semantics, and the documentation states that it should be used instead. Signed-off-by: Rodrigo Tobar --- standard_plots/utilities_statistics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard_plots/utilities_statistics.py b/standard_plots/utilities_statistics.py index 308208dd..5f49e87b 100644 --- a/standard_plots/utilities_statistics.py +++ b/standard_plots/utilities_statistics.py @@ -212,7 +212,7 @@ def density_contour(ax, xdata, ydata, nbins_x, nbins_y, cmap = 'viridis'): kwargs to be passed to pyplot.contour() """ - H, xedges, yedges = np.histogram2d(xdata, ydata, bins=(nbins_x,nbins_y), normed=True) + H, xedges, yedges = np.histogram2d(xdata, ydata, bins=(nbins_x,nbins_y), density=True) x_bin_sizes = (xedges[1:] - xedges[:-1]).reshape((1,nbins_x)) y_bin_sizes = (yedges[1:] - yedges[:-1]).reshape((nbins_y,1))