Fix make_norm_from_scale `__name__` when used inline. · matplotlib/matplotlib@a00a909 · GitHub
Skip to content

Commit a00a909

Browse files
committed
Fix make_norm_from_scale __name__ when used inline.
`make_norm_from_scale` can be used "inline", rather than as a class decorator, to dynamically create norm classes. However, in that case, the second parameter (`base_norm_cls`) would normally be set to the root base norm class (`mcolors.Normalize`). In that case, we should generate a new `__name__` for the dynamically generated class, to avoid the slightly confusing situation of having two different classes both called `mcolors.Normalize`.
1 parent 9465538 commit a00a909

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

lib/matplotlib/colors.py

Lines changed: 2 additions & 1 deletion

lib/matplotlib/tests/test_colors.py

Lines changed: 6 additions & 0 deletions

0 commit comments

Comments
 (0)