3
$ßL]É^  ã               @   sÜ  d dl Z d dlZd dlZd dlmZ d dlmZmZmZ d dl	m
Z
mZmZmZmZmZmZmZmZmZ d dlmZmZ G dd„ deƒZG dd	„ d	eƒZG d
d„ deƒZG dd„ deƒZejddd�G dd„ deƒƒZejddd�G dd„ deƒƒZejddd�G dd„ deƒƒZejddd�G dd„ deƒƒZ ejddd�G dd„ deƒƒZ!ejddd�G dd„ deƒƒZ"ejddd�G dd„ deƒƒZ#ejddd�G d d!„ d!eƒƒZ$G d"d„ deƒZ%G d#d„ deƒZ&G d$d%„ d%eƒZ'G d&d'„ d'e'ƒZ(G d(d)„ d)eƒZ)G d*d+„ d+eƒZ*G d,d-„ d-eƒZ+G d.d/„ d/eƒZ,G d0d1„ d1eƒZ-G d2d3„ d3eƒZ.ee'e+e.ee(d4œZ/d5d6„ Z0d7d8„ Z1e1j2�rŠe1j2d9d:j3e0ƒ ƒi e1_2d;d<„ Z4ejdd=d>�d?d@„ ƒZ5dAdB„ Z6ej7j8dCj3dDdE„ e0ƒ D ƒƒe6ƒ j9ƒ dF� dS )Gé    N)Úma)ÚcbookÚ	docstringÚrcParams)
ÚNullFormatterÚScalarFormatterÚLogFormatterSciNotationÚLogitFormatterÚNullLocatorÚ
LogLocatorÚAutoLocatorÚAutoMinorLocatorÚSymmetricalLogLocatorÚLogitLocator)Ú	TransformÚIdentityTransformc               @   s0   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
S )Ú	ScaleBasea@  
    The base class for all scales.

    Scales are separable transformations, working on a single dimension.

    Any subclasses will want to override:

      - :attr:`name`
      - :meth:`get_transform`
      - :meth:`set_default_locators_and_formatters`

    And optionally:
      - :meth:`limit_range_for_scale`
    c             K   s   dS )a‰  
        Construct a new scale.

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

        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ÚaxisÚkwargsr   r   ú8/tmp/pip-install-edjban26/matplotlib/matplotlib/scale.pyÚ__init__   s    zScaleBase.__init__c             C   s
   t ƒ ‚dS )zq
        Return the :class:`~matplotlib.transforms.Transform` object
        associated with this scale.
        N)ÚNotImplementedError)r   r   r   r   Úget_transform-   s    zScaleBase.get_transformc             C   s
   t ƒ ‚dS )z¦
        Set the :class:`~matplotlib.ticker.Locator` and
        :class:`~matplotlib.ticker.Formatter` objects on the given
        axis to match this scale.
        N)r   )r   r   r   r   r   Ú#set_default_locators_and_formatters4   s    z-ScaleBase.set_default_locators_and_formattersc             C   s   ||fS )zù
        Returns the range *vmin*, *vmax*, possibly limited to the
        domain supported by this scale.

        *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Úminposr   r   r   Úlimit_range_for_scale<   s    zScaleBase.limit_range_for_scaleN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r      s
   r   c                   s4   e Zd ZdZdZ‡ fdd„Zdd„ Zdd„ Z‡  ZS )	ÚLinearScalez#
    The default linear scale.
    Úlinearc                s   t ƒ j|f|Ž dS )z	
        N)Úsuperr   )r   r   r   )Ú	__class__r   r   r   N   s    zLinearScale.__init__c             C   sf   |j tƒ ƒ |jtƒ ƒ |jtƒ ƒ |jdkr6td sH|jdkrVtd rV|jt	ƒ ƒ n|jt
ƒ ƒ dS )zd
        Set the locators and formatters to reasonable defaults for
        linear scaling.
        Úxzxtick.minor.visibleÚyzytick.minor.visibleN)Úset_major_locatorr   Úset_major_formatterr   Úset_minor_formatterr   Ú	axis_namer   Úset_minor_locatorr   r
   )r   r   r   r   r   r   V   s    z/LinearScale.set_default_locators_and_formattersc             C   s   t ƒ S )zy
        The transform for linear scaling is just the
        :class:`~matplotlib.transforms.IdentityTransform`.
        )r   )r   r   r   r   r   e   s    zLinearScale.get_transform)	r    r!   r"   r#   Únamer   r   r   Ú__classcell__r   r   )r'   r   r$   G   s
   r$   c                   s@   e Zd ZdZdZdZdZdZ‡ fdd„Zdd„ Z	dd	„ Z
‡  ZS )
ÚFuncTransformzi
    A simple transform that takes and arbitrary function for the
    forward and inverse transform.
    é   Tc                s4   t ƒ jƒ  t|ƒr(t|ƒr(|| _|| _ntdƒ‚dS )a¤  
        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)r&   r   ÚcallableÚ_forwardÚ_inverseÚ
ValueError)r   ÚforwardÚinverse)r'   r   r   r   x   s
    
zFuncTransform.__init__c             C   s
   | j |ƒS )N)r4   )r   Úvaluesr   r   r   Útransform_non_affine�   s    z"FuncTransform.transform_non_affinec             C   s   t | j| jƒS )N)r1   r5   r4   )r   r   r   r   Úinverted’   s    zFuncTransform.inverted)r    r!   r"   r#   Ú
input_dimsÚoutput_dimsÚis_separableÚhas_inverser   r:   r;   r0   r   r   )r'   r   r1   m   s   r1   c               @   s,   e Zd ZdZdZdd„ Zdd„ Zdd„ Zd	S )
Ú	FuncScalezN
    Provide an arbitrary scale with user-supplied function for the axis.
    Úfunctionc             C   s   |\}}t ||ƒ}|| _dS )aq  
        Parameters
        ----------

        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)r1   Ú
_transform)r   r   Ú	functionsr7   r8   Ú	transformr   r   r   r   �   s    
zFuncScale.__init__c             C   s   | j S )z5
        The transform for arbitrary scaling
        )rB   )r   r   r   r   r   °   s    zFuncScale.get_transformc             C   sf   |j tƒ ƒ |jtƒ ƒ |jtƒ ƒ |jdkr6td sH|jdkrVtd rV|jt	ƒ ƒ n|jt
ƒ ƒ dS )zc
        Set the locators and formatters to the same defaults as the
        linear scale.
        r(   zxtick.minor.visibler)   zytick.minor.visibleN)r*   r   r+   r   r,   r   r-   r   r.   r   r
   )r   r   r   r   r   r   ¶   s    z-FuncScale.set_default_locators_and_formattersN)r    r!   r"   r#   r/   r   r   r   r   r   r   r   r@   –   s
   r@   z3.1ÚLogTransform)Úalternativec               @   s6   e Zd ZdZdZdZdZddd„Zdd„ Zdd	„ Z	d
S )ÚLogTransformBaser2   TÚclipc             C   s   t j| ƒ dddœ| | _d S )NTF)rH   Úmask)r   r   Ú_clip)r   Únonposr   r   r   r   Í   s    
zLogTransformBase.__init__c             C   s   t j| |ƒS )N)rE   r:   )r   Úar   r   r   r:   Ñ   s    z%LogTransformBase.transform_non_affinec             C   s   dj t| ƒj| jrdndƒS )Nz{}({!r})rH   rI   )ÚformatÚtyper    rJ   )r   r   r   r   Ú__str__Ô   s    zLogTransformBase.__str__N)rH   )
r    r!   r"   r<   r=   r>   r?   r   r:   rO   r   r   r   r   rG   Æ   s   
rG   ÚInvertedLogTransformc               @   s,   e Zd ZdZdZdZdZdd„ Zdd„ ZdS )ÚInvertedLogTransformBaser2   Tc             C   s   t j| j|ƒS )N)r   ÚpowerÚbase)r   rL   r   r   r   r:   à   s    z-InvertedLogTransformBase.transform_non_affinec             C   s   dj t| ƒjƒS )Nz{}())rM   rN   r    )r   r   r   r   rO   ã   s    z InvertedLogTransformBase.__str__N)	r    r!   r"   r<   r=   r>   r?   r:   rO   r   r   r   r   rQ   Ù   s   rQ   c               @   s   e Zd ZdZdd„ ZdS )ÚLog10Transformg      $@c             C   s   t ƒ S )N)ÚInvertedLog10Transform)r   r   r   r   r;   ë   s    zLog10Transform.invertedN)r    r!   r"   rS   r;   r   r   r   r   rT   ç   s   rT   c               @   s   e Zd ZdZdd„ ZdS )rU   g      $@c             C   s   t ƒ S )N)rT   )r   r   r   r   r;   ó   s    zInvertedLog10Transform.invertedN)r    r!   r"   rS   r;   r   r   r   r   rU   ï   s   rU   c               @   s   e Zd ZdZdd„ ZdS )ÚLog2Transformg       @c             C   s   t ƒ S )N)ÚInvertedLog2Transform)r   r   r   r   r;   û   s    zLog2Transform.invertedN)r    r!   r"   rS   r;   r   r   r   r   rV   ÷   s   rV   c               @   s   e Zd ZdZdd„ ZdS )rW   g       @c             C   s   t ƒ S )N)rV   )r   r   r   r   r;     s    zInvertedLog2Transform.invertedN)r    r!   r"   rS   r;   r   r   r   r   rW   ÿ   s   rW   c               @   s   e Zd ZejZdd„ ZdS )ÚNaturalLogTransformc             C   s   t ƒ S )N)ÚInvertedNaturalLogTransform)r   r   r   r   r;     s    zNaturalLogTransform.invertedN)r    r!   r"   ÚnpÚerS   r;   r   r   r   r   rX     s   rX   c               @   s   e Zd ZejZdd„ ZdS )rY   c             C   s   t ƒ S )N)rX   )r   r   r   r   r;     s    z$InvertedNaturalLogTransform.invertedN)r    r!   r"   rZ   r[   rS   r;   r   r   r   r   rY     s   rY   c               @   s>   e Zd ZdZdZdZdZddd„Zdd„ Zdd	„ Z	d
d„ Z
dS )rE   r2   TrH   c             C   s$   t j| ƒ || _dddœ| | _d S )NTF)rH   rI   )r   r   rS   rJ   )r   rS   rK   r   r   r   r     s    
zLogTransform.__init__c             C   s    dj t| ƒj| j| jrdndƒS )Nz{}(base={}, nonpos={!r})rH   rI   )rM   rN   r    rS   rJ   )r   r   r   r   rO   "  s    zLogTransform.__str__c             C   sx   t jddd��` t jt jdt jdt jij| jƒ}|r>||ƒ}nt j|ƒ}|t j| jƒ }| jrjd||dk< W d Q R X |S )NÚignore)ÚdivideÚinvalidé   é
   iè  r   iüÿÿ)	rZ   Úerrstater[   ÚlogÚlog2Úlog10ÚgetrS   rJ   )r   rL   rb   Úoutr   r   r   r:   &  s     


z!LogTransform.transform_non_affinec             C   s
   t | jƒS )N)rP   rS   )r   r   r   r   r;   <  s    zLogTransform.invertedN)rH   )r    r!   r"   r<   r=   r>   r?   r   rO   r:   r;   r   r   r   r   rE     s   
c               @   s<   e Zd ZdZdZdZdZdd„ Zdd„ Zdd„ Z	d	d
„ Z
dS )rP   r2   Tc             C   s   t j| ƒ || _d S )N)r   r   rS   )r   rS   r   r   r   r   F  s    
zInvertedLogTransform.__init__c             C   s   dj t| ƒj| jƒS )Nz{}(base={}))rM   rN   r    rS   )r   r   r   r   rO   J  s    zInvertedLogTransform.__str__c             C   s   t j| j|ƒS )N)r   rR   rS   )r   rL   r   r   r   r:   M  s    z)InvertedLogTransform.transform_non_affinec             C   s
   t | jƒS )N)rE   rS   )r   r   r   r   r;   P  s    zInvertedLogTransform.invertedN)r    r!   r"   r<   r=   r>   r?   r   rO   r:   r;   r   r   r   r   rP   @  s   c               @   sd   e Zd ZdZdZeZeZeZeZe	Z	e
Z
eZeZeZdd„ Zedd„ ƒZdd„ Zd	d
„ Zdd„ ZdS )ÚLogScalezT
    A standard logarithmic scale.  Care is taken to only plot positive values.
    rb   c             K   sÂ   |j dkrB|jddƒ}|jddƒ}|jddƒ}tjddg|d	� n6|jd
dƒ}|jddƒ}|jddƒ}tjddg|d� t|ƒr’tddj|ƒ ƒ‚|dks¢|dkrªtdƒ‚| j||ƒ| _|| _	dS )a   
        *basex*/*basey*:
           The base of the logarithm

        *nonposx*/*nonposy*: {'mask', 'clip'}
          non-positive values in *x* or *y* can be masked as
          invalid, or clipped to a very small positive number

        *subsx*/*subsy*:
           Where to place the subticks between each major tick.
           Should be a sequence of integers.  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.
        r(   Úbasexg      $@ÚsubsxNÚnonposxrH   rI   )rj   ÚbaseyÚsubsyÚnonposy)rm   zrprovided too many kwargs, can only pass {'basex', 'subsx', nonposx'} or {'basey', 'subsy', nonposy'}.  You passed z{!r}r   r2   z#The log base cannot be <= 0 or == 1)
r-   Úpopr   Ú_check_in_listÚlenr6   rM   rE   rB   Úsubs)r   r   r   rS   rq   rK   r   r   r   r   e  s     
zLogScale.__init__c             C   s   | j jS )N)rB   rS   )r   r   r   r   rS   �  s    zLogScale.basec             C   sR   |j t| jƒƒ |jt| jƒƒ |jt| j| jƒƒ |jt| j| jdk	d�ƒ dS )zb
        Set the locators and formatters to specialized versions for
        log scaling.
        N)ZlabelOnlyBase)r*   r   rS   r+   r   r.   rq   r,   )r   r   r   r   r   r   ‘  s    z,LogScale.set_default_locators_and_formattersc             C   s   | j S )z
        Return a :class:`~matplotlib.transforms.Transform` instance
        appropriate for the given logarithm base.
        )rB   )r   r   r   r   r   �  s    zLogScale.get_transformc             C   s.   t j|ƒsd}|dkr|n||dkr(|n|fS )z6
        Limit the domain to positive values.
        gYóøÂn¥r   )rZ   Úisfinite)r   r   r   r   r   r   r   r   ¤  s    
zLogScale.limit_range_for_scaleN)r    r!   r"   r#   r/   rG   rT   rU   rV   rW   rX   rY   rE   rP   r   ÚpropertyrS   r   r   r   r   r   r   r   rg   T  s    (rg   c               @   s2   e Zd ZdZdZddd„Zedd„ ƒZdd	„ Zd
S )ÚFuncScaleLogzu
    Provide an arbitrary scale with user-supplied function for the axis and
    then put on a logarithmic axes.
    Úfunctionlogr`   c             C   s&   |\}}d| _ t||ƒt|ƒ | _dS )aÂ  
        Parameters
        ----------

        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
            logarithmic base of the scale (default = 10)

        N)rq   r1   rE   rB   )r   r   rC   rS   r7   r8   r   r   r   r   ¸  s    zFuncScaleLog.__init__c             C   s
   | j jjS )N)rB   Ú_brS   )r   r   r   r   rS   Ï  s    zFuncScaleLog.basec             C   s   | j S )z5
        The transform for arbitrary scaling
        )rB   )r   r   r   r   r   Ó  s    zFuncScaleLog.get_transformN)r`   )	r    r!   r"   r#   r/   r   rs   rS   r   r   r   r   r   rt   °  s
   
rt   c               @   s4   e Zd ZdZdZdZdZdd„ Zdd„ Zdd„ Z	d	S )
ÚSymmetricalLogTransformr2   Tc             C   s@   t j| ƒ || _|| _|| _|d| jd   | _tj|ƒ| _d S )Ng      ð?r2   éÿÿÿÿ)	r   r   rS   Ú	linthreshÚlinscaleÚ_linscale_adjrZ   rb   Ú	_log_base)r   rS   ry   rz   r   r   r   r   à  s    
z SymmetricalLogTransform.__init__c             C   sp   t j|ƒ}t jddd��< t j|ƒ| j | jt j|| j ƒ| j   }|| jk}W d Q R X || | j ||< |S )Nr\   )r]   r^   )rZ   Úabsra   Úsignry   r{   rb   r|   )r   rL   Úabs_arf   Úinsider   r   r   r:   è  s    
z,SymmetricalLogTransform.transform_non_affinec             C   s   t | j| j| jƒS )N)ÚInvertedSymmetricalLogTransformrS   ry   rz   )r   r   r   r   r;   ò  s    
z SymmetricalLogTransform.invertedN)
r    r!   r"   r<   r=   r>   r?   r   r:   r;   r   r   r   r   rw   Ú  s   
rw   c               @   s4   e Zd ZdZdZdZdZdd„ Zdd„ Zdd„ Z	d	S )
r�   r2   Tc             C   sL   t j| ƒ t|||ƒ}|| _|| _|j|ƒ| _|| _|d| jd   | _d S )Ng      ð?r2   rx   )	r   r   rw   rS   ry   rD   Úinvlinthreshrz   r{   )r   rS   ry   rz   Úsymlogr   r   r   r   ý  s    
z(InvertedSymmetricalLogTransform.__init__c             C   sn   t j|ƒ}t jddd��: t j|ƒ| j t j| j|| j | j ƒ }|| jk}W d Q R X || | j ||< |S )Nr\   )r]   r^   )	rZ   r}   ra   r~   ry   rR   rS   r{   r‚   )r   rL   r   rf   r€   r   r   r   r:     s    
z4InvertedSymmetricalLogTransform.transform_non_affinec             C   s   t | j| j| jƒS )N)rw   rS   ry   rz   )r   r   r   r   r;     s    z(InvertedSymmetricalLogTransform.invertedN)
r    r!   r"   r<   r=   r>   r?   r   r:   r;   r   r   r   r   r�   ÷  s   	
r�   c               @   s4   e Zd ZdZdZeZeZdd„ Zdd„ Zdd„ Z	d	S )
ÚSymmetricalLogScaleaJ  
    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*).

    Parameters
    ----------
    basex, basey : float
        The base of the logarithm. Defaults to 10.

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

    subsx, subsy : 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.

    linscalex, linscaley : 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ƒ   c             K   sÈ   |j dkr<|jddƒ}|jddƒ}|jdd ƒ}|jddƒ}n0|jd	dƒ}|jd
dƒ}|jdd ƒ}|jddƒ}|dkr|tdƒ‚|dkrŒtdƒ‚|dkrœtdƒ‚| j|||ƒ| _|| _|| _|| _|| _d S )Nr(   rh   g      $@Z
linthreshxg       @ri   Z	linscalexg      ð?rk   Z
linthreshyrl   Z	linscaleyz#'basex/basey' must be larger than 1g        z('linthreshx/linthreshy' must be positivez''linscalex/linthreshy' must be positive)	r-   rn   r6   rw   rB   rS   ry   rz   rq   )r   r   r   rS   ry   rq   rz   r   r   r   r   :  s,    
zSymmetricalLogScale.__init__c             C   sH   |j t| jƒ ƒƒ |jt| jƒƒ |jt| jƒ | jƒƒ |jt	ƒ ƒ dS )zn
        Set the locators and formatters to specialized versions for
        symmetrical log scaling.
        N)
r*   r   r   r+   r   rS   r.   rq   r,   r   )r   r   r   r   r   r   V  s
    
z7SymmetricalLogScale.set_default_locators_and_formattersc             C   s   | j S )zE
        Return a :class:`SymmetricalLogTransform` instance.
        )rB   )r   r   r   r   r   a  s    z!SymmetricalLogScale.get_transformN)
r    r!   r"   r#   r/   rw   r�   r   r   r   r   r   r   r   r„     s   r„   c               @   s>   e Zd ZdZdZdZdZddd„Zdd„ Zdd	„ Z	d
d„ Z
dS )ÚLogitTransformr2   TrI   c             C   s$   t j| ƒ || _dddœ| | _d S )NTF)rH   rI   )r   r   Ú_nonposrJ   )r   rK   r   r   r   r   n  s    
zLogitTransform.__init__c             C   sN   t jddd�� t j|d|  ƒ}W dQ R X | jrJd||dk< d|d|k< |S )z,logit transform (base 10), masked or clippedr\   )r]   r^   r2   Niè  r   iüÿÿ)rZ   ra   rd   rJ   )r   rL   rf   r   r   r   r:   s  s    z#LogitTransform.transform_non_affinec             C   s
   t | jƒS )N)ÚLogisticTransformr†   )r   r   r   r   r;   |  s    zLogitTransform.invertedc             C   s   dj t| ƒj| jrdndƒS )Nz{}({!r})rH   rI   )rM   rN   r    rJ   )r   r   r   r   rO     s    zLogitTransform.__str__N)rI   )r    r!   r"   r<   r=   r>   r?   r   r:   r;   rO   r   r   r   r   r…   h  s   
	r…   c               @   s>   e Zd ZdZdZdZdZddd„Zdd„ Zdd	„ Z	d
d„ Z
dS )r‡   r2   TrI   c             C   s   t j| ƒ || _d S )N)r   r   r†   )r   rK   r   r   r   r   Š  s    
zLogisticTransform.__init__c             C   s   ddd|    S )zlogistic transform (base 10)g      ð?r2   r`   r   )r   rL   r   r   r   r:   Ž  s    z&LogisticTransform.transform_non_affinec             C   s
   t | jƒS )N)r…   r†   )r   r   r   r   r;   ’  s    zLogisticTransform.invertedc             C   s   dj t| ƒj| jƒS )Nz{}({!r}))rM   rN   r    r†   )r   r   r   r   rO   •  s    zLogisticTransform.__str__N)rI   )r    r!   r"   r<   r=   r>   r?   r   r:   r;   rO   r   r   r   r   r‡   „  s   
r‡   c               @   s6   e Zd ZdZdZddd„Zdd„ Zdd	„ Zd
d„ ZdS )Ú
LogitScalezÜ
    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[.
    ÚlogitrI   c             C   s    t jddg|d� t|ƒ| _dS )z›
        *nonpos*: {'mask', 'clip'}
          values beyond ]0, 1[ can be masked as invalid, or clipped to a number
          very close to 0 or 1
        rI   rH   )rK   N)r   ro   r…   rB   )r   r   rK   r   r   r   r   ¢  s    zLogitScale.__init__c             C   s   | j S )z<
        Return a :class:`LogitTransform` instance.
        )rB   )r   r   r   r   r   «  s    zLogitScale.get_transformc             C   s8   |j tƒ ƒ |jtƒ ƒ |jtdd�ƒ |jtƒ ƒ d S )NT)Úminor)r*   r   r+   r	   r.   r,   )r   r   r   r   r   r   ±  s    z.LogitScale.set_default_locators_and_formattersc             C   s2   t j|ƒsd}|dkr|n||dkr,d| n|fS )zH
        Limit the domain to values between 0 and 1 (excluded).
        gH¯¼šò×z>r   r2   )rZ   rr   )r   r   r   r   r   r   r   r   ¸  s    
z LogitScale.limit_range_for_scaleN)rI   )	r    r!   r"   r#   r/   r   r   r   r   r   r   r   r   rˆ   ™  s   
	rˆ   )r%   rb   rƒ   r‰   rA   ru   c               C   s   t tƒS )N)ÚsortedÚ_scale_mappingr   r   r   r   Úget_scale_namesÍ  s    r�   c             K   s,   | j ƒ } | tkrtd|  ƒ‚t|  |f|ŽS )zn
    Return a scale class by name.

    Parameters
    ----------
    scale : {%(names)s}
    axis : Axis
    zUnknown scale type '%s')ÚlowerrŒ   r6   )Úscaler   r   r   r   r   Úscale_factoryÑ  s    	r�   Únamesz, c             C   s   | t | j< dS )zd
    Register a new kind of scale.

    *scale_class* must be a subclass of :class:`ScaleBase`.
    N)rŒ   r/   )Úscale_classr   r   r   Úregister_scaleä  s    r“   zdget_scale_docs() is considered private API since 3.1 and will be removed from the public API in 3.3.)Úmessagec               C   s   t ƒ S )zF
    Helper function for generating docstrings related to scales.
    )Ú_get_scale_docsr   r   r   r   Úget_scale_docsí  s    r–   c              C   sL   g } x<t jƒ D ]0\}}| jd|›�dtjtj|jƒdƒdgƒ qW dj| ƒS )zF
    Helper function for generating docstrings related to scales.
    z    Ú ú é   Ú
z        )	rŒ   ÚitemsÚextendÚtextwrapÚindentÚinspectÚgetdocr   Újoin)Zdocsr/   r’   r   r   r   r•   ÷  s    r•   z | c             C   s   g | ]}t |ƒ‘qS r   )Úrepr)Ú.0r(   r   r   r   ú
<listcomp>  s    r¤   )r�   Z
scale_docs):rŸ   r�   ZnumpyrZ   r   Z
matplotlibr   r   r   Zmatplotlib.tickerr   r   r   r	   r
   r   r   r   r   r   Zmatplotlib.transformsr   r   Úobjectr   r$   r1   r@   Ú
deprecatedrG   rQ   rT   rU   rV   rW   rX   rY   rE   rP   rg   rt   rw   r�   r„   r…   r‡   rˆ   rŒ   r�   r�   r#   r¡   r“   r–   r•   ZinterpdÚupdateÚrstripr   r   r   r   Ú<module>   sl   08&)0)\*S+		