Skip to content

Commit

Permalink
Prefer histogram's "density" argument over "normed"
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rtobar committed Sep 12, 2023
1 parent 69dfb77 commit d8b7eac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion standard_plots/utilities_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit d8b7eac

Please sign in to comment.