1919 NullLocator , LogLocator , AutoLocator , AutoMinorLocator ,
2020 SymmetricalLogLocator , LogitLocator )
2121from matplotlib .transforms import Transform , IdentityTransform
22+ from matplotlib .cbook import warn_deprecated
2223
2324
2425class ScaleBase :
@@ -52,6 +53,14 @@ def __init__(self, axis, **kwargs):
5253 be used: a single scale object should be usable by multiple
5354 `~matplotlib.axis.Axis`\es at the same time.
5455 """
56+ if kwargs :
57+ warn_deprecated (
58+ '3.2.0' ,
59+ message = (
60+ f"ScaleBase got an unexpected keyword "
61+ f"argument { next (iter (kwargs ))!r} . "
62+ 'In the future this will raise TypeError' )
63+ )
5564
5665 def get_transform (self ):
5766 """
@@ -143,8 +152,7 @@ def forward(values: array-like) -> array-like
143152 self ._forward = forward
144153 self ._inverse = inverse
145154 else :
146- raise ValueError ('arguments to FuncTransform must '
147- 'be functions' )
155+ raise ValueError ('arguments to FuncTransform must be functions' )
148156
149157 def transform_non_affine (self , values ):
150158 return self ._forward (values )
@@ -382,16 +390,14 @@ def __init__(self, axis, **kwargs):
382390 nonpos = kwargs .pop ('nonposy' , 'clip' )
383391 cbook ._check_in_list (['mask' , 'clip' ], nonposy = nonpos )
384392
385- if len (kwargs ):
386- raise ValueError (("provided too many kwargs, can only pass "
387- "{'basex', 'subsx', nonposx'} or "
388- "{'basey', 'subsy', nonposy'}. You passed " ) +
389- "{!r}" .format (kwargs ))
393+ if kwargs :
394+ raise TypeError (f"LogScale got an unexpected keyword "
395+ f"argument { next (iter (kwargs ))!r} " )
390396
391397 if base <= 0 or base == 1 :
392398 raise ValueError ('The log base cannot be <= 0 or == 1' )
393399
394- self ._transform = self . LogTransform (base , nonpos )
400+ self ._transform = LogTransform (base , nonpos )
395401 self .subs = subs
396402
397403 @property
@@ -566,6 +572,16 @@ def __init__(self, axis, **kwargs):
566572 linthresh = kwargs .pop ('linthreshy' , 2.0 )
567573 subs = kwargs .pop ('subsy' , None )
568574 linscale = kwargs .pop ('linscaley' , 1.0 )
575+ if kwargs :
576+ warn_deprecated (
577+ '3.2.0' ,
578+ message = (
579+ f"SymmetricalLogScale got an unexpected keyword "
580+ f"argument { next (iter (kwargs ))!r} . "
581+ 'In the future this will raise TypeError' )
582+ )
583+ # raise TypeError(f"SymmetricalLogScale got an unexpected keyword "
584+ # f"argument {next(iter(kwargs))!r}")
569585
570586 if base <= 1.0 :
571587 raise ValueError ("'basex/basey' must be larger than 1" )
@@ -574,10 +590,7 @@ def __init__(self, axis, **kwargs):
574590 if linscale <= 0.0 :
575591 raise ValueError ("'linscalex/linthreshy' must be positive" )
576592
577- self ._transform = self .SymmetricalLogTransform (base ,
578- linthresh ,
579- linscale )
580-
593+ self ._transform = SymmetricalLogTransform (base , linthresh , linscale )
581594 self .base = base
582595 self .linthresh = linthresh
583596 self .linscale = linscale
0 commit comments