
    h,i                     `   S r SSKrSSKrSSKrSSKrSSKJrJr  SSK	J
r
JrJrJrJrJrJrJrJrJrJr  SSKJrJr   " S S5      r " S S	\5      r " S
 S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r  " S S\5      r! " S S\5      r" " S S\5      r# " S S\5      r$ " S  S!\5      r% " S" S#\5      r& " S$ S%\5      r' " S& S'\5      r(\\\"\%\(\\S(.r)S) r*S* r+\+R                   (       a1  \+R                   S+S,RY                  \-" \.\*" 5       5      5      0-  \+l         S- r/S. r0\Rb                  Re                  S/S,RY                  \*" 5        V s/ s H  n \." U 5      PM     sn 5      -  \0" 5       Rg                  5       S09  gs  sn f )1a  
Scales define the distribution of data values on an axis, e.g. a log scaling.

The mapping is implemented through `.Transform` subclasses.

The following scales are built-in:

.. _builtin_scales:

============= ===================== ================================ =================================
Name          Class                 Transform                        Inverted transform
============= ===================== ================================ =================================
"asinh"       `AsinhScale`          `AsinhTransform`                 `InvertedAsinhTransform`
"function"    `FuncScale`           `FuncTransform`                  `FuncTransform`
"functionlog" `FuncScaleLog`        `FuncTransform` + `LogTransform` `InvertedLogTransform` + `FuncTransform`
"linear"      `LinearScale`         `.IdentityTransform`             `.IdentityTransform`
"log"         `LogScale`            `LogTransform`                   `InvertedLogTransform`
"logit"       `LogitScale`          `LogitTransform`                 `LogisticTransform`
"symlog"      `SymmetricalLogScale` `SymmetricalLogTransform`        `InvertedSymmetricalLogTransform`
============= ===================== ================================ =================================

A user will often only use the scale name, e.g. when setting the scale through
`~.Axes.set_xscale`: ``ax.set_xscale("log")``.

See also the :ref:`scales examples <sphx_glr_gallery_scales>` in the documentation.

Custom scaling can be achieved through `FuncScale`, or by creating your own
`ScaleBase` subclass and corresponding transforms (see :doc:`/gallery/scales/custom_scale`).
Third parties can register their scales by name through `register_scale`.
    N)_api
_docstring)NullFormatterScalarFormatterLogFormatterSciNotationLogitFormatterNullLocator
LogLocatorAutoLocatorAutoMinorLocatorSymmetricalLogLocatorAsinhLocatorLogitLocator)	TransformIdentityTransformc                   0    \ rS rSrSrS rS rS rS rSr	g)		ScaleBase.   a  
The base class for all scales.

Scales are separable transformations, working on a single dimension.

Subclasses should override

:attr:`name`
    The scale's name.
:meth:`get_transform`
    A method returning a `.Transform`, which converts data coordinates to
    scaled coordinates.  This transform should be invertible, so that e.g.
    mouse positions can be converted back to data coordinates.
:meth:`set_default_locators_and_formatters`
    A method that sets default locators and formatters for an `~.axis.Axis`
    that uses this scale.
:meth:`limit_range_for_scale`
    An optional method that "fixes" the axis range to acceptable values,
    e.g. restricting log-scaled axes to positive values.
c                     g)aA  
Construct a new scale.

Notes
-----
The following note is for scale implementers.

For back-compatibility reasons, scales take an `~matplotlib.axis.Axis`
object as first argument.  However, this argument should not
be used: a single scale object should be usable by multiple
`~matplotlib.axis.Axis`\es at the same time.
N selfaxiss     B/var/www/html/env/lib/python3.13/site-packages/matplotlib/scale.py__init__ScaleBase.__init__D           c                     [        5       e)z<
Return the `.Transform` object associated with this scale.
NotImplementedErrorr   s    r   get_transformScaleBase.get_transformR   s     "##r   c                     [        5       e)zQ
Set the locators and formatters of *axis* to instances suitable for
this scale.
r    r   s     r   #set_default_locators_and_formatters-ScaleBase.set_default_locators_and_formattersX   s    
 "##r   c                     X4$ )z
Return the range *vmin*, *vmax*, restricted to the
domain supported by this scale (if any).

*minpos* should be the minimum positive value in the data.
This is used by log scales to determine a minimum value.
r   r   vminvmaxminposs       r   limit_range_for_scaleScaleBase.limit_range_for_scale_   s     zr   r   N)
__name__
__module____qualname____firstlineno____doc__r   r#   r&   r-   __static_attributes__r   r   r   r   r   .   s    *$$r   r   c                   .    \ rS rSrSrSrS rS rS rSr	g)	LinearScalej   z
The default linear scale.
linearc                     g)z	
        Nr   r   s     r   r   LinearScale.__init__q   r   r   c                    UR                  [        5       5        UR                  [        5       5        UR	                  [        5       5        UR                  S:X  a  [        R                  S   (       d(  UR                  S:X  a2  [        R                  S   (       a  UR                  [        5       5        g UR                  [        5       5        g Nxzxtick.minor.visibleyzytick.minor.visibleset_major_locatorr   set_major_formatterr   set_minor_formatterr   	axis_namemplrcParamsset_minor_locatorr   r	   r   s     r   r&   /LinearScale.set_default_locators_and_formattersx       {}-  !23  1NNc!cll3H&I#%#,,7L*M""#3#56"";=1r   c                     [        5       $ )zh
Return the transform for linear scaling, which is just the
`~matplotlib.transforms.IdentityTransform`.
)r   r"   s    r   r#   LinearScale.get_transform   s    
 !""r   r   N)
r/   r0   r1   r2   r3   namer   r&   r#   r4   r   r   r   r6   r6   j   s     D
2#r   r6   c                   @   ^  \ rS rSrSrS=rrU 4S jrS rS r	Sr
U =r$ )FuncTransform   z]
A simple transform that takes and arbitrary function for the
forward and inverse transform.
   c                    > [         TU ]  5         [        U5      (       a  [        U5      (       a  Xl        X l        g[        S5      e)aS  
Parameters
----------
forward : callable
    The forward function for the transform.  This function must have
    an inverse and, for best behavior, be monotonic.
    It must have the signature::

       def forward(values: array-like) -> array-like

inverse : callable
    The inverse of the forward function.  Signature as ``forward``.
z,arguments to FuncTransform must be functionsN)superr   callable_forward_inverse
ValueError)r   forwardinverse	__class__s      r   r   FuncTransform.__init__   s;     	G'!2!2#M#MKLLr   c                 $    U R                  U5      $ N)rS   r   valuess     r   transform_non_affine"FuncTransform.transform_non_affine   s    }}V$$r   c                 B    [        U R                  U R                  5      $ r[   )rM   rT   rS   r"   s    r   invertedFuncTransform.inverted   s    T]]DMM::r   )rS   rT   r/   r0   r1   r2   r3   
input_dimsoutput_dimsr   r^   ra   r4   __classcell__rX   s   @r   rM   rM      s)    
  ! JM*%; ;r   rM   c                   .    \ rS rSrSrSrS rS rS rSr	g)		FuncScale   zF
Provide an arbitrary scale with user-supplied function for the axis.
functionc                 .    Uu  p4[        X45      nXPl        g)aE  
Parameters
----------
axis : `~matplotlib.axis.Axis`
    The axis for the scale.
functions : (callable, callable)
    two-tuple of the forward and inverse functions for the scale.
    The forward function must be monotonic.

    Both functions must have the signature::

       def forward(values: array-like) -> array-like
N)rM   
_transform)r   r   	functionsrV   rW   	transforms         r   r   FuncScale.__init__   s     %!'3	#r   c                     U R                   $ )z7Return the `.FuncTransform` associated with this scale.rm   r"   s    r   r#   FuncScale.get_transform       r   c                    UR                  [        5       5        UR                  [        5       5        UR	                  [        5       5        UR                  S:X  a  [        R                  S   (       d(  UR                  S:X  a2  [        R                  S   (       a  UR                  [        5       5        g UR                  [        5       5        g r<   r?   r   s     r   r&   -FuncScale.set_default_locators_and_formatters   rH   r   rr   N)
r/   r0   r1   r2   r3   rK   r   r#   r&   r4   r   r   r   ri   ri      s     D$$
2r   ri   c                   F   ^  \ rS rSrS=rrSU 4S jjrS rS rS r	Sr
U =r$ )	LogTransform   rO   c                    > [         TU ]  5         US::  d  US:X  a  [        S5      eXl        [        R
                  " SSS.US9U l        g )Nr   rO   z#The log base cannot be <= 0 or == 1TFclipmasknonpositive)rQ   r   rU   baser   check_getitem_clip)r   r   r   rX   s      r   r   LogTransform.__init__   sI    19	BCC	''5){D
r   c                     SR                  [        U 5      R                  U R                  U R                  (       a  S5      $ S5      $ )Nz{}(base={}, nonpositive={!r})r|   r}   )formattyper/   r   r   r"   s    r   __str__LogTransform.__str__   sA    .55JdjjFN 	NFLN 	Nr   c                    [         R                  " SSS9   [         R                  [         R                  S[         R                  S[         R
                  0R                  U R                  5      nU(       a	  U" U5      nO9[         R                  " U5      nU[         R                  " U R                  5      -  nU R                  (       a  SX1S:*  '   S S S 5        U$ ! , (       d  f       W$ = f)Nignoredivideinvalid   
   r   )	nperrstateeloglog2log10getr   r   )r   r]   r   outs       r   r^   !LogTransform.transform_non_affine   s    [[(;44BGGR:>>tyyIC&kffVnrvvdii((zz $)aK # <$ 
% <;$ 
s   B;C
C*c                 ,    [        U R                  5      $ r[   )InvertedLogTransformr   r"   s    r   ra   LogTransform.inverted   s    #DII..r   )r   r   )r|   r/   r0   r1   r2   rd   re   r   r   r^   ra   r4   rf   rg   s   @r   rx   rx      s(      JDN,/ /r   rx   c                   B   ^  \ rS rSrS=rrU 4S jrS rS rS r	Sr
U =r$ )r   i  rO   c                 .   > [         TU ]  5         Xl        g r[   )rQ   r   r   )r   r   rX   s     r   r   InvertedLogTransform.__init__  s    	r   c                 L    [        U 5      R                   SU R                   S3$ )Nz(base=))r   r/   r   r"   s    r   r   InvertedLogTransform.__str__
  s$    t*%%&fTYYKq99r   c                 D    [         R                  " U R                  U5      $ r[   )r   powerr   r\   s     r   r^   )InvertedLogTransform.transform_non_affine  s    xx		6**r   c                 ,    [        U R                  5      $ r[   )rx   r   r"   s    r   ra   InvertedLogTransform.inverted  s    DII&&r   r   r   rg   s   @r   r   r     s&      J:+' 'r   r   c                   R    \ rS rSrSrSrSSSS.S jr\" S	 5      rS
 r	S r
S rSrg)LogScalei  zL
A standard logarithmic scale.  Care is taken to only plot positive values.
r   r   Nr|   )r   subsr   c                0    [        X$5      U l        X0l        g)a3  
Parameters
----------
axis : `~matplotlib.axis.Axis`
    The axis for the scale.
base : float, default: 10
    The base of the logarithm.
nonpositive : {'clip', 'mask'}, default: 'clip'
    Determines the behavior for non-positive values. They can either
    be masked as invalid, or clipped to a very small positive number.
subs : sequence of int, default: None
    Where to place the subticks between each major tick.  For example,
    in a log10 scale, ``[2, 3, 4, 5, 6, 7, 8, 9]`` will place 8
    logarithmically spaced minor ticks between each major tick.
N)rx   rm   r   )r   r   r   r   r   s        r   r   LogScale.__init__  s      't9	r   c                 .    U R                   R                  $ r[   rm   r   r"   s    r   <lambda>LogScale.<lambda>-      !5!5r   c                 P   UR                  [        U R                  5      5        UR                  [	        U R                  5      5        UR                  [        U R                  U R                  5      5        UR                  [	        U R                  U R                  S LS95        g )N)labelOnlyBase)r@   r
   r   rA   r   rF   r   rB   r   s     r   r&   ,LogScale.set_default_locators_and_formatters/  sx    z$))45  !8!CDz$))TYY?@  #DII3799D3HK	Lr   c                     U R                   $ )z6Return the `.LogTransform` associated with this scale.rr   r"   s    r   r#   LogScale.get_transform8  rt   r   c                 f    [         R                  " U5      (       d  SnUS::  a  UOUUS::  a  U4$ U4$ )z$Limit the domain to positive values.gYnr   r   isfiniter)   s       r   r-   LogScale.limit_range_for_scale<  sA    {{6""F!)!)/ 	/)-/ 	/r   rm   r   )r/   r0   r1   r2   r3   rK   r   propertyr   r&   r#   r-   r4   r   r   r   r   r     s7     D%'d & 56DL/r   r   c                   <    \ rS rSrSrSrS	S jr\S 5       rS r	Sr
g)
FuncScaleLogiE  zi
Provide an arbitrary scale with user-supplied function for the axis and
then put on a logarithmic axes.
functionlogc                 R    Uu  pESU l         [        XE5      [        U5      -   U l        g)a  
Parameters
----------
axis : `~matplotlib.axis.Axis`
    The axis for the scale.
functions : (callable, callable)
    two-tuple of the forward and inverse functions for the scale.
    The forward function must be monotonic.

    Both functions must have the signature::

        def forward(values: array-like) -> array-like

base : float, default: 10
    Logarithmic base of the scale.
N)r   rM   rx   rm   )r   r   rn   r   rV   rW   s         r   r   FuncScaleLog.__init__M  s)    " %	'9L<NNr   c                 B    U R                   R                  R                  $ r[   )rm   _br   r"   s    r   r   FuncScaleLog.baseb  s    !!&&&r   c                     U R                   $ )z3Return the `.Transform` associated with this scale.rr   r"   s    r   r#   FuncScaleLog.get_transformf  rt   r   r   N)r   )r/   r0   r1   r2   r3   rK   r   r   r   r#   r4   r   r   r   r   r   E  s-    
 DO* ' 'r   r   c                   <   ^  \ rS rSrS=rrU 4S jrS rS rSr	U =r
$ )SymmetricalLogTransformik  rO   c                   > [         TU ]  5         US::  a  [        S5      eUS::  a  [        S5      eUS::  a  [        S5      eXl        X l        X0l        USU R                  S-  -
  -  U l        [        R                  " U5      U l	        g )N      ?z'base' must be larger than 1        z'linthresh' must be positivez'linscale' must be positive)
rQ   r   rU   r   	linthreshlinscale_linscale_adjr   r   	_log_base)r   r   r   r   rX   s       r   r    SymmetricalLogTransform.__init__n  s    3;;<<;<<s?:;;	" &#		R*?@r   c                    [         R                  " U5      n[         R                  " SSS9   [         R                  " U5      U R                  -  U R
                  [         R                  " X R                  -  5      U R                  -  -   -  nX R                  :*  nS S S 5        UW   U R
                  -  WU'   U$ ! , (       d  f       N%= fNr   r   )r   absr   signr   r   r   r   r   r]   abs_ar   insides        r   r^   ,SymmetricalLogTransform.transform_non_affine|  s    v[[(;''&/DNN2""u~~-.?@AC nn,F	 <
 Vnt'9'99F
 <;s   A/B::
Cc                 X    [        U R                  U R                  U R                  5      $ r[   )InvertedSymmetricalLogTransformr   r   r   r"   s    r   ra    SymmetricalLogTransform.inverted  s"    .tyy$../3}}> 	>r   )r   r   r   r   r   r/   r0   r1   r2   rd   re   r   r^   ra   r4   rf   rg   s   @r   r   r   k  s!      J&> >r   r   c                   <   ^  \ rS rSrS=rrU 4S jrS rS rSr	U =r
$ )r   i  rO   c                    > [         TU ]  5         [        XU5      nXl        X l        UR                  U5      U l        X0l        USU R                  S-  -
  -  U l        g )Nr   r   )	rQ   r   r   r   r   ro   invlinthreshr   r   )r   r   r   r   symlogrX   s        r   r   (InvertedSymmetricalLogTransform.__init__  sV    ((C	"",,Y7 &#		R*?@r   c                    [         R                  " U5      n[         R                  " SSS9   [         R                  " U5      U R                  -  [         R
                  " U R                  X R                  -  U R                  -
  5      -  nX R                  :*  nS S S 5        UW   U R                  -  WU'   U$ ! , (       d  f       N%= fr   )	r   r   r   r   r   r   r   r   r   r   s        r   r^   4InvertedSymmetricalLogTransform.transform_non_affine  s    v[[(;''&/DNN2/$2D2DDFGC ///F	 <
 Vnt'9'99F
 <;s   A-B88
Cc                 X    [        U R                  U R                  U R                  5      $ r[   )r   r   r   r   r"   s    r   ra   (InvertedSymmetricalLogTransform.inverted  s$    &tyy'+~~t}}F 	Fr   )r   r   r   r   r   r   rg   s   @r   r   r     s$      JBF Fr   r   c                   r    \ rS rSrSrSrSSSSS.S	 jr\" S
 5      r\" S 5      r	\" S 5      r
S rS rSrg)SymmetricalLogScalei  a  
The symmetrical logarithmic scale is logarithmic in both the
positive and negative directions from the origin.

Since the values close to zero tend toward infinity, there is a
need to have a range around zero that is linear.  The parameter
*linthresh* allows the user to specify the size of this range
(-*linthresh*, *linthresh*).

See :doc:`/gallery/scales/symlog_demo` for a detailed description.

Parameters
----------
base : float, default: 10
    The base of the logarithm.

linthresh : float, default: 2
    Defines the range ``(-x, x)``, within which the plot is linear.
    This avoids having the plot go to infinity around zero.

subs : sequence of int
    Where to place the subticks between each major tick.
    For example, in a log10 scale: ``[2, 3, 4, 5, 6, 7, 8, 9]`` will place
    8 logarithmically spaced minor ticks between each major tick.

linscale : float, optional
    This allows the linear range ``(-linthresh, linthresh)`` to be
    stretched relative to the logarithmic range. Its value is the number of
    decades to use for each half of the linear range. For example, when
    *linscale* == 1.0 (the default), the space used for the positive and
    negative halves of the linear range will be equal to one decade in
    the logarithmic range.
r   r   r   NrO   )r   r   r   r   c                2    [        X#U5      U l        X@l        g r[   )r   rm   r   )r   r   r   r   r   r   s         r   r   SymmetricalLogScale.__init__  s    1$8L	r   c                 .    U R                   R                  $ r[   r   r"   s    r   r   SymmetricalLogScale.<lambda>  r   r   c                 .    U R                   R                  $ r[   )rm   r   r"   s    r   r   r     s    doo&?&?r   c                 .    U R                   R                  $ r[   )rm   r   r"   s    r   r   r     s    T__%=%=r   c                 4   UR                  [        U R                  5       5      5        UR                  [	        U R
                  5      5        UR                  [        U R                  5       U R                  5      5        UR                  [        5       5        g r[   )
r@   r   r#   rA   r   r   rF   r   rB   r   r   s     r   r&   7SymmetricalLogScale.set_default_locators_and_formatters  sq    4T5G5G5IJK  !8!CD4T5G5G5I59YY @ 	A  1r   c                     U R                   $ )zAReturn the `.SymmetricalLogTransform` associated with this scale.rr   r"   s    r   r#   !SymmetricalLogScale.get_transform  rt   r   r   )r/   r0   r1   r2   r3   rK   r   r   r   r   r   r&   r#   r4   r   r   r   r   r     sJ     B D%'14!  56D?@I=>H2r   r   c                   @   ^  \ rS rSrSrS=rrU 4S jrS rS r	Sr
U =r$ )AsinhTransformi  z<Inverse hyperbolic-sine transformation used by `.AsinhScale`rO   c                 P   > [         TU ]  5         US::  a  [        S5      eXl        g )Nr   z8Scale parameter 'linear_width' must be strictly positive)rQ   r   rU   linear_widthr   r   rX   s     r   r   AsinhTransform.__init__  s.    3 9 : :(r   c                 `    U R                   [        R                  " XR                   -  5      -  $ r[   )r   r   arcsinhr\   s     r   r^   #AsinhTransform.transform_non_affine  s%      2::f7H7H.H#IIIr   c                 ,    [        U R                  5      $ r[   )InvertedAsinhTransformr   r"   s    r   ra   AsinhTransform.inverted  s    %d&7&788r   r   rc   rg   s   @r   r   r     s%    F  J)J9 9r   r   c                   @   ^  \ rS rSrSrS=rrU 4S jrS rS r	Sr
U =r$ )r   i  z4Hyperbolic sine transformation used by `.AsinhScale`rO   c                 .   > [         TU ]  5         Xl        g r[   )rQ   r   r   r   s     r   r   InvertedAsinhTransform.__init__  s    (r   c                 `    U R                   [        R                  " XR                   -  5      -  $ r[   )r   r   sinhr\   s     r   r^   +InvertedAsinhTransform.transform_non_affine  s%      27764E4E+E#FFFr   c                 ,    [        U R                  5      $ r[   )r   r   r"   s    r   ra   InvertedAsinhTransform.inverted      d//00r   r  rc   rg   s   @r   r   r     s%    >  J)G1 1r   r   c            	       p   ^  \ rS rSrSrSrSSSSSSSS	S
.rSSSS.U 4S jjr\" S 5      r	S r
S rSrU =r$ )
AsinhScale   a  
A quasi-logarithmic scale based on the inverse hyperbolic sine (asinh)

For values close to zero, this is essentially a linear scale,
but for large magnitude values (either positive or negative)
it is asymptotically logarithmic. The transition between these
linear and logarithmic regimes is smooth, and has no discontinuities
in the function gradient in contrast to
the `.SymmetricalLogScale` ("symlog") scale.

Specifically, the transformation of an axis coordinate :math:`a` is
:math:`a \rightarrow a_0 \sinh^{-1} (a / a_0)` where :math:`a_0`
is the effective width of the linear region of the transformation.
In that region, the transformation is
:math:`a \rightarrow a + \mathcal{O}(a^3)`.
For large values of :math:`a` the transformation behaves as
:math:`a \rightarrow a_0 \, \mathrm{sgn}(a) \ln |a| + \mathcal{O}(1)`.

.. note::

   This API is provisional and may be revised in the future
   based on early user feedback.
asinh)r   )r      )r      )r   r     )r     )   r  )   r  r  r  r   r  @   i   r   r   auto)r   r   r   c                   > [         TU ]  U5        [        U5      U l        [	        U5      U l        US:X  a+  U R                  R                  U R
                  5      U l        gX@l        g)a  
Parameters
----------
linear_width : float, default: 1
    The scale parameter (elsewhere referred to as :math:`a_0`)
    defining the extent of the quasi-linear region,
    and the coordinate values beyond which the transformation
    becomes asymptotically logarithmic.
base : int, default: 10
    The number base used for rounding tick locations
    on a logarithmic scale. If this is less than one,
    then rounding is to the nearest integer multiple
    of powers of ten.
subs : sequence of int
    Multiples of the number base used for minor ticks.
    If set to 'auto', this will use built-in defaults,
    e.g. (2, 5) for base=10.
r  N)	rQ   r   r   rm   int_baseauto_tick_multipliersr   _subs)r   r   r   r   r   kwargsrX   s         r   r   AsinhScale.__init__&  sQ    ( 	(6Y
6>3377

CDJJr   c                 .    U R                   R                  $ r[   )rm   r   r"   s    r   r   AsinhScale.<lambda>B  s    )E)Er   c                     U R                   $ r[   rr   r"   s    r   r#   AsinhScale.get_transformD  s    r   c           	      H   UR                  [        U R                  U R                  S9[        U R                  U R                  U R                  S9[        5       S9  U R                  S:  a%  UR                  [        U R                  5      5        g UR                  S5        g )Nr   )r   r   )major_locatorminor_locatorminor_formatterrO   z{x:.3g})setr   r   r  r  r   rA   r   r   s     r   r&   .AsinhScale.set_default_locators_and_formattersG  s    |D,=,=15 =+D,=,=1515 = "/ 	 	2 ::>$$%<TZZ%HI$$Y/r   )r  r  rm   )r/   r0   r1   r2   r3   rK   r  r   r   r   r#   r&   r4   rf   rg   s   @r   r  r     sa    0 D 	 .1v 8 EFL
0 
0r   r  c                   F   ^  \ rS rSrS=rrSU 4S jjrS rS rS r	Sr
U =r$ )	LogitTransformiT  rO   c                 v   > [         TU ]  5         [        R                  " SS/US9  Xl        SSS.U   U l        g )Nr}   r|   r~   TFr{   )rQ   r   r   check_in_list_nonpositiver   r   r   rX   s     r   r   LogitTransform.__init__W  s:    FF+E'"E2;?
r   c                     [         R                  " SSS9   [         R                  " USU-
  -  5      nSSS5        U R                  (       a  SWUS:*  '   SUSU:*  '   W$ ! , (       d  f       N1= f)z,logit transform (base 10), masked or clippedr   r   rO   Nr   r   i  )r   r   r   r   )r   r]   r   s      r   r^   #LogitTransform.transform_non_affine]  s]    [[(;((6QZ01C <::$C!#CV
 <;s   A
A,c                 ,    [        U R                  5      $ r[   )LogisticTransformr,  r"   s    r   ra   LogitTransform.invertedf  s     !2!233r   c                 N    [        U 5      R                   SU R                  < S3$ N(r   r   r/   r,  r"   s    r   r   LogitTransform.__str__i  '    t*%%&a(9(9'<A>>r   )r   r,  r}   r/   r0   r1   r2   rd   re   r   r^   ra   r   r4   rf   rg   s   @r   r)  r)  T  s'      J@4? ?r   r)  c                   F   ^  \ rS rSrS=rrSU 4S jjrS rS rS r	Sr
U =r$ )	r2  im  rO   c                 .   > [         TU ]  5         Xl        g r[   )rQ   r   r,  r-  s     r   r   LogisticTransform.__init__p  s    'r   c                     SSSU* -  -   -  $ )zlogistic transform (base 10)r   rO   r   r   r\   s     r   r^   &LogisticTransform.transform_non_affinet  s    a"w-'((r   c                 ,    [        U R                  5      $ r[   )r)  r,  r"   s    r   ra   LogisticTransform.invertedx  r
  r   c                 N    [        U 5      R                   SU R                  < S3$ r5  r7  r"   s    r   r   LogisticTransform.__str__{  r9  r   )r,  r:  r;  rg   s   @r   r2  r2  m  s&      J()1? ?r   r2  c                   B    \ rS rSrSrSrSSSS.S jjrS rS	 rS
 r	Sr
g)
LogitScalei  z
Logit scale for data between zero and one, both excluded.

This scale is similar to a log scale close to zero and to one, and almost
linear around 0.5. It maps the interval ]0, 1[ onto ]-infty, +infty[.
logitz\frac{1}{2}Fone_halfuse_overlinec                <    [        U5      U l        X@l        X0l        g)a  
Parameters
----------
axis : `~matplotlib.axis.Axis`
    Currently unused.
nonpositive : {'mask', 'clip'}
    Determines the behavior for values beyond the open interval ]0, 1[.
    They can either be masked as invalid, or clipped to a number very
    close to 0 or 1.
use_overline : bool, default: False
    Indicate the usage of survival notation (\overline{x}) in place of
    standard notation (1-x) for probability close to one.
one_half : str, default: r"\frac{1}{2}"
    The string used for ticks formatter to represent 1/2.
N)r)  rm   _use_overline	_one_half)r   r   r   rI  rJ  s        r   r   LogitScale.__init__  s    " )5)!r   c                     U R                   $ )z8Return the `.LogitTransform` associated with this scale.rr   r"   s    r   r#   LogitScale.get_transform  rt   r   c                    UR                  [        5       5        UR                  [        U R                  U R
                  S95        UR                  [        SS95        UR                  [        SU R                  U R
                  S95        g )NrH  T)minor)rR  rI  rJ  )r@   r   rA   r   rM  rL  rF   rB   r   s     r   r&   .LogitScale.set_default_locators_and_formatters  sx     	|~.  !//	
 	|$78  !//	
r   c                 l    [         R                  " U5      (       d  SnUS::  a  UOUUS:  a  SU-
  4$ U4$ )z8
Limit the domain to values between 0 and 1 (excluded).
gHz>r   rO   r   r)   s       r   r-    LogitScale.limit_range_for_scale  sG     {{6""F!)"aiF
3 	3-13 	3r   )rM  rm   rL  Nr:  )r/   r0   r1   r2   r3   rK   r   r#   r&   r-   r4   r   r   r   rF  rF    s,     D"(u"*
&3r   rF  )r8   r   r   r  rG  rk   r   c                       [        [        5      $ )z)Return the names of the available scales.)sorted_scale_mappingr   r   r   get_scale_namesrY    s    .!!r   c                 F    [         R                  " [        U S9nU" U40 UD6$ )zi
Return a scale class by name.

Parameters
----------
scale : {%(names)s}
axis : `~matplotlib.axis.Axis`
)scale)r   r   rX  )r[  r   r  	scale_clss       r   scale_factoryr]    s&     "">?IT$V$$r   namesz, c                 *    U [         U R                  '   g)zw
Register a new kind of scale.

Parameters
----------
scale_class : subclass of `ScaleBase`
    The scale to register.
N)rX  rK   )scale_classs    r   register_scalera    s     (3N;##$r   c            	         / n [         R                  5        H\  u  p[        R                  " UR                  5      =(       d    SnU R                  SU< 3S[        R                  " US5      S/5        M^     SR                  U 5      $ )z>
Helper function for generating docstrings related to scales.
 z    z        
)	rX  itemsinspectgetdocr   extendtextwrapindentjoin)docsrK   r`  	docstrings       r   _get_scale_docsrn    sv     D+113NN;#7#78>B	4(OOOIw/	
 	 4 99T?r   z{%s})
scale_type
scale_docs)4r3   rf  ri  numpyr   
matplotlibrD   r   r   matplotlib.tickerr   r   r   r   r	   r
   r   r   r   r   r   matplotlib.transformsr   r   r   r6   rM   ri   rx   r   r   r   r   r   r   r   r   r  r)  r2  rF  rX  rY  r]  rk  mapreprra  rn  interpdregisterrstrip)r=   s   0r   <module>rz     s  >     '7 7 7 7 ?9 9x#) #D!;I !;H'2	 '2T&/9 &/R'9 '"./y ./b#8 #L>i >@Fi F66) 6r9Y 9$1Y 1Q0 Q0h?Y ?2?	 ?$<3 <3@ !"

% )113t_%6785: :M	3      		O4E"F4Eq474E"FGG '')  "Fs   9F+