Skip to content

Commit 904b7ed

Browse files
committed
ENH: expose make_norm_from_scale
1 parent 29da23a commit 904b7ed

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/matplotlib/colors.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,13 +1416,13 @@ def __call__(self, value, clip=None):
14161416
return super().__call__(value, clip=clip)
14171417

14181418

1419-
def _make_norm_from_scale(scale_cls, base_norm_cls=None, *, init=None):
1419+
def make_norm_from_scale(scale_cls, base_norm_cls=None, *, init=None):
14201420
"""
14211421
Decorator for building a `.Normalize` subclass from a `.Scale` subclass.
14221422
14231423
After ::
14241424
1425-
@_make_norm_from_scale(scale_cls)
1425+
@make_norm_from_scale(scale_cls)
14261426
class norm_cls(Normalize):
14271427
...
14281428
@@ -1437,7 +1437,7 @@ class norm_cls(Normalize):
14371437
a dummy axis).
14381438
14391439
If the *scale_cls* constructor takes additional parameters, then *init*
1440-
should be passed to `_make_norm_from_scale`. It is a callable which is
1440+
should be passed to `make_norm_from_scale`. It is a callable which is
14411441
*only* used for its signature. First, this signature will become the
14421442
signature of *norm_cls*. Second, the *norm_cls* constructor will bind the
14431443
parameters passed to it using this signature, extract the bound *vmin*,
@@ -1447,7 +1447,7 @@ class norm_cls(Normalize):
14471447
"""
14481448

14491449
if base_norm_cls is None:
1450-
return functools.partial(_make_norm_from_scale, scale_cls, init=init)
1450+
return functools.partial(make_norm_from_scale, scale_cls, init=init)
14511451

14521452
if init is None:
14531453
def init(vmin=None, vmax=None, clip=False): pass
@@ -1509,7 +1509,7 @@ def inverse(self, value):
15091509
return Norm
15101510

15111511

1512-
@_make_norm_from_scale(
1512+
@make_norm_from_scale(
15131513
scale.FuncScale,
15141514
init=lambda functions, vmin=None, vmax=None, clip=False: None)
15151515
class FuncNorm(Normalize):
@@ -1542,7 +1542,7 @@ def forward(values: array-like) -> array-like
15421542
"""
15431543

15441544

1545-
@_make_norm_from_scale(functools.partial(scale.LogScale, nonpositive="mask"))
1545+
@make_norm_from_scale(functools.partial(scale.LogScale, nonpositive="mask"))
15461546
class LogNorm(Normalize):
15471547
"""Normalize a given value to the 0-1 range on a log scale."""
15481548

@@ -1555,7 +1555,7 @@ def autoscale_None(self, A):
15551555
super().autoscale_None(np.ma.masked_less_equal(A, 0, copy=False))
15561556

15571557

1558-
@_make_norm_from_scale(
1558+
@make_norm_from_scale(
15591559
scale.SymmetricalLogScale,
15601560
init=lambda linthresh, linscale=1., vmin=None, vmax=None, clip=False, *,
15611561
base=10: None)

0 commit comments

Comments
 (0)