diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index 0843bd5f592c..f5081825c2ab 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -1561,7 +1561,8 @@ def inverse(self, value): .reshape(np.shape(value))) return value[0] if is_scalar else value - Norm.__name__ = base_norm_cls.__name__ + Norm.__name__ = (f"{scale_cls.__name__}Norm" if base_norm_cls is Normalize + else base_norm_cls.__name__) Norm.__qualname__ = base_norm_cls.__qualname__ Norm.__module__ = base_norm_cls.__module__ Norm.__doc__ = base_norm_cls.__doc__ diff --git a/lib/matplotlib/tests/test_colors.py b/lib/matplotlib/tests/test_colors.py index bf89a3a82364..4fa65918e7fa 100644 --- a/lib/matplotlib/tests/test_colors.py +++ b/lib/matplotlib/tests/test_colors.py @@ -1475,3 +1475,9 @@ def test_norm_update_figs(fig_test, fig_ref): # Force initial draw to make sure it isn't already stale fig_test.canvas.draw() norm.vmin, norm.vmax = 10, 90 + + +def test_make_norm_from_scale_name(): + logitnorm = mcolors.make_norm_from_scale( + mscale.LogitScale, mcolors.Normalize) + assert logitnorm.__name__ == "LogitScaleNorm"