There was an error while loading. Please reload this page.
1 parent 77d5e8e commit 90b0f4dCopy full SHA for 90b0f4d
2 files changed
lib/matplotlib/cbook/deprecation.py
@@ -285,18 +285,18 @@ def func(good_name): ...
285
signature = inspect.signature(func)
286
assert old not in signature.parameters, (
287
f"Matplotlib internal error: {old!r} cannot be a parameter for "
288
- "{func.__name__}()")
+ f"{func.__name__}()")
289
assert new in signature.parameters, (
290
f"Matplotlib internal error: {new!r} must be a parameter for "
291
292
293
@functools.wraps(func)
294
def wrapper(*args, **kwargs):
295
if old in kwargs:
296
warn_deprecated(
297
since, message=f"The {old!r} parameter of {func.__name__}() "
298
- f"has been renamed {new!r} since {since}; support for the old "
299
- f"name will be dropped %(removal)s.")
+ f"has been renamed {new!r} since Matplotlib {since}; support "
+ f"for the old name will be dropped %(removal)s.")
300
kwargs[new] = kwargs.pop(old)
301
return func(*args, **kwargs)
302
lib/matplotlib/tests/test_axes.py
@@ -1739,6 +1739,17 @@ def test_hist2d_transpose():
1739
ax.hist2d(x, y, bins=10, rasterized=True)
1740
1741
1742
+def test_hist2d_density_normed():
1743
+ x, y = np.random.random((2, 100))
1744
+ ax = plt.figure().subplots()
1745
+ for obj in [ax, plt]:
1746
+ obj.hist2d(x, y, density=True)
1747
+ with pytest.warns(MatplotlibDeprecationWarning):
1748
+ obj.hist2d(x, y, normed=True)
1749
1750
+ obj.hist2d(x, y, density=True, normed=True)
1751
+
1752
1753
class TestScatter(object):
1754
@image_comparison(baseline_images=['scatter'],
1755
style='mpl20', remove_text=True)
0 commit comments