Ë
    ¸Ó^j%  ã                   óô   — d dl mZmZ d dlmZ d dlmZ d dlm	Z	 ddl
mZ  G d„ d«      Z ej                  ed«      Z ee«      Z G d	„ d
«      Z ej                  edd«      xZZ ee«      xZZeddœd„ZeZy)é    )Ú_apiÚcbookN)ÚBboxé   )ÚAxesc                   ó\   ‡ — e Zd Zdddœˆ fd„Zˆ fd„Zd„ Zˆ fd„Zˆ fd„Zd„ Zd	„ Z	d
„ Z
ˆ xZS )ÚParasiteAxesBaseN)Úviewlim_modec                ó¤   •— || _         || _        | j                  |«       d|d<   t        ‰| �  |j                  d¬«      |j                  fi |¤Ž y )NFÚframeon)Úroot)Ú_parent_axesÚtransAuxÚset_viewlim_modeÚsuperÚ__init__Ú
get_figureÚ	_position)ÚselfÚparent_axesÚaux_transformr
   ÚkwargsÚ	__class__s        €úp/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/mpl_toolkits/axes_grid1/parasite_axes.pyr   zParasiteAxesBase.__init__
   sX   ø€ à'ˆÔØ%ˆŒØ×Ñ˜lÔ+Ø!ˆˆyÑÜ‰Ñ˜×/Ñ/°UÐ/Ó;Ø$×.Ñ.ñ	:Ø28ó	:ó    c                 ób  •— t         ‰| �  «        t        j                  | j	                  «       d¬«       | j
                  j                  | _        | j
                  j                  j                  d| j                  «       | j
                  j                  j                  d| j                  «       y )NF)ÚvisibleÚxlim_changedÚylim_changed)
r   ÚclearÚmartistÚsetpÚget_childrenr   Ú
_get_linesÚ	callbacksÚ_connect_picklableÚ
_sync_lims©r   r   s    €r   r    zParasiteAxesBase.clear   s|   ø€ Ü‰‰ŒÜ�‰�T×&Ñ&Ó(°%Õ8Ø×+Ñ+×6Ñ6ˆŒØ×Ñ×#Ñ#×6Ñ6Ø˜DŸO™Oô	-à×Ñ×#Ñ#×6Ñ6Ø˜DŸO™Oõ	-r   c                 ó6   — | j                   j                  «       S ©N)r   Úget_axes_locator©r   s    r   r+   z!ParasiteAxesBase.get_axes_locator   s   € Ø× Ñ ×1Ñ1Ó3Ð3r   c                 óÐ   •— t         ‰| �  |«       | j                  «       D ]C  }t        |j                  d«      sŒ| |j                  j
                  v sŒ3|j                  |«       ŒE y )NÚ	parasites)r   Úpickr#   ÚhasattrÚinaxesr.   ©r   Ú
mouseeventÚar   s      €r   r/   zParasiteAxesBase.pick   s[   ø€ ô 	‰‰�ZÔ ð ×"Ñ"Ó$ò 	#ˆAÜ˜
×)Ñ)¨;Õ7Ø 
× 1Ñ 1× ;Ñ ;Ò;Ø—‘�zÕ"ñ	#r   c                 ó~  •— | j                   �¢| j                  j                  | _        | j                   | j                  j                  z   | _        t	        j
                  | j                  | j                  «      | _        t	        j
                  | j                  | j                  «      | _        y t        ‰| �%  «        y r*   )
r   r   Ú	transAxesÚ	transDataÚmtransformsÚblended_transform_factoryÚ_xaxis_transformÚ_yaxis_transformr   Ú_set_lim_and_transformsr(   s    €r   r<   z(ParasiteAxesBase._set_lim_and_transforms-   s‰   ø€ Ø�=‰=Ð$Ø!×.Ñ.×8Ñ8ˆDŒNØ!Ÿ]™]¨T×->Ñ->×-HÑ-HÑHˆDŒNÜ$/×$IÑ$IØ—‘ §¡ó%0ˆDÔ!ä$/×$IÑ$IØ—‘ §¡ó%0ˆDÕ!ô ‰GÑ+Õ-r   c                 óD   — t        j                  g d¢|¬«       || _        y )N©NÚequalÚ	transform©Úmode)r   Úcheck_in_listÚ_viewlim_mode)r   rB   s     r   r   z!ParasiteAxesBase.set_viewlim_mode8   s   € Ü×ÑÒ7¸dÕCØ!ˆÕr   c                 ó   — | j                   S r*   )rD   r,   s    r   Úget_viewlim_modez!ParasiteAxesBase.get_viewlim_mode<   s   € Ø×!Ñ!Ð!r   c                 ób  — |j                   j                  «       }| j                  «       }|€y |dk(  r| j                   j                  |«       y |dk(  rC| j                   j                  |j	                  | j
                  j                  «       «      «       y t        j                  g d¢|¬«       y )Nr?   r@   r>   rA   )	ÚviewLimÚfrozenrF   ÚsetÚtransformedr   Úinvertedr   rC   )r   ÚparentÚviewlimrB   s       r   r'   zParasiteAxesBase._sync_lims?   s†   € Ø—.‘.×'Ñ'Ó)ˆØ×$Ñ$Ó&ˆØˆ<ØØ�WŠ_Ø�L‰L×Ñ˜WÕ%Ø�[Ò Ø�L‰L×Ñ˜W×0Ñ0°·±×1GÑ1GÓ1IÓJÕKä×ÑÒ;À$ÖGr   r*   )Ú__name__Ú
__module__Ú__qualname__r   r    r+   r/   r<   r   rF   r'   Ú__classcell__©r   s   @r   r	   r	      s4   ø„ ð:Ø!%ö:ô-ò4ô
#ô	.ò"ò"ö
Hr   r	   z
{}Parasitec                   ó~   ‡ — e Zd Zˆ fd„Z	 dd„Zˆ fd„Zˆ fd„Zˆ fd„Zdd„Zdd„Z	dd	„Z
d
„ Zd„ Zddddœˆ fd„Zˆ xZS )ÚHostAxesBasec                 ó2   •— g | _         t        ‰| �  |i |¤Ž y r*   )r.   r   r   )r   Úargsr   r   s      €r   r   zHostAxesBase.__init__T   s   ø€ ØˆŒÜ‰Ñ˜$Ð) &Ó)r   Nc                 ó¼   — |€| j                   }t        |«      } || |fd|i|¤Ž}| j                  j                  |«       | j                  j                  |_        |S )ad  
        Add a parasite axes to this host.

        Despite this method's name, this should actually be thought of as an
        ``add_parasite_axes`` method.

        .. versionchanged:: 3.7
           Defaults to same base axes class as host axes.

        Parameters
        ----------
        tr : `~matplotlib.transforms.Transform` or None, default: None
            If a `.Transform`, the following relation will hold:
            ``parasite.transData = tr + host.transData``.
            If None, the parasite's and the host's ``transData`` are unrelated.
        viewlim_mode : {"equal", "transform", None}, default: "equal"
            How the parasite's view limits are set: directly equal to the
            parent axes ("equal"), equal after application of *tr*
            ("transform"), or independently (None).
        axes_class : subclass type of `~matplotlib.axes.Axes`, optional
            The `~.axes.Axes` subclass that is instantiated.  If None, the base
            class of the host axes is used.
        **kwargs
            Other parameters are forwarded to the parasite axes constructor.
        r
   )Ú_base_axes_classÚparasite_axes_class_factoryr.   ÚappendÚremoveÚ_remove_method)r   Útrr
   Ú
axes_classr   Úparasite_axes_classÚax2s          r   Úget_aux_axeszHostAxesBase.get_aux_axesX   sj   € ð6 ÐØ×.Ñ.ˆJÜ9¸*ÓEÐÙ!Ø�"ñ;Ø#/ð;Ø39ñ;ˆð 	�‰×Ñ˜cÔ"Ø!Ÿ^™^×2Ñ2ˆÔØˆ
r   c                 óÂ  •— t        | j                  «      }| j                  «       }|r. || |«      }| j                  |d¬«       | j	                  |«       n| j	                  «        | j                  «       }| j                  D ]<  }|j	                  |«       | j                  j                  |j                  «       «       Œ> t        ‰| �)  |«       | j                  |d …= y )NÚactive)Úwhich)ÚlenÚ	_childrenr+   Úset_positionÚapply_aspectÚget_positionr.   Úextendr#   r   Údraw)r   ÚrendererÚorig_children_lenÚlocatorÚposÚrectÚaxr   s          €r   rl   zHostAxesBase.draw~   sÀ   ø€ Ü §¡Ó/Ðà×'Ñ'Ó)ˆÙÙ˜$ Ó)ˆCØ×Ñ˜c¨ÐÔ2Ø×Ñ˜cÕ"à×ÑÔà× Ñ Ó"ˆØ—.‘.ò 	5ˆBØ�O‰O˜DÔ!Ø�N‰N×!Ñ! "§/¡/Ó"3Õ4ð	5ô 	‰‰�XÔØ�N‰NÐ,Ñ-Ñ.r   c                 ód   •— t         ‰| �  «        | j                  D ]  }|j                  «        Œ y r*   )r   r    r.   )r   rr   r   s     €r   r    zHostAxesBase.clear‘   s(   ø€ Ü‰‰ŒØ—.‘.ò 	ˆBØ�H‰H�Jñ	r   c                 óh   •— t         ‰| �  |«       | j                  D ]  }|j                  |«       Œ y r*   )r   r/   r.   r2   s      €r   r/   zHostAxesBase.pick–   s0   ø€ Ü‰‰�ZÔ ð —‘ò 	ˆAØ�F‰F�:Õñ	r   c                 óà   — | j                  || ¬«      }| j                  d   j                  d«       |j                  d   j                  d«       |j                  d   j                  d«       |S )zÈ
        Create a twin of Axes with a shared x-axis but independent y-axis.

        The y-axis of self will have ticks on the left and the returned axes
        will have ticks on the right.
        )ÚsharexÚrightFT)ÚleftÚtopÚbottom©Ú_add_twin_axesÚaxisÚset_visible©r   r_   rr   s      r   ÚtwinxzHostAxesBase.twinx�   sd   € ð × Ñ  °DÐ Ó9ˆØ�	‰	�'Ñ×&Ñ& uÔ-Ø
�‰�Ñ×$Ñ$ TÔ*Ø
�‰Ð'Ñ(×4Ñ4°UÔ;Øˆ	r   c                 óà   — | j                  || ¬«      }| j                  d   j                  d«       |j                  d   j                  d«       |j                  d   j                  d«       |S )zÈ
        Create a twin of Axes with a shared y-axis but independent x-axis.

        The x-axis of self will have ticks on the bottom and the returned axes
        will have ticks on the top.
        )Úshareyry   FT)rx   rw   rz   r{   r   s      r   ÚtwinyzHostAxesBase.twinyª   sc   € ð × Ñ  °DÐ Ó9ˆØ�	‰	�%Ñ×$Ñ$ UÔ+Ø
�‰�‰×"Ñ" 4Ô(Ø
�‰Ð)Ñ*×6Ñ6°uÔ=Øˆ	r   c                 ó  — |€t        j                  «       }| j                  ||d¬«      }| j                  d   j	                  d«       |j                  d   j	                  d«       |j                  d   j	                  d«       |S )zÂ
        Create a twin of Axes with no shared axis.

        While self will have ticks on the left and bottom axis, the returned
        axes will have ticks on the top and right axis.
        r@   )r   r
   )ry   rw   FT)rx   rz   )r8   ÚIdentityTransformr|   r}   r~   )r   Ú	aux_transr_   rr   s       r   ÚtwinzHostAxesBase.twin·   s€   € ð ÐÜ#×5Ñ5Ó7ˆIØ× Ñ Ø i¸kð !ó Kˆà�	‰	�.Ñ!×-Ñ-¨eÔ4Ø
�‰�Ñ×+Ñ+¨DÔ1Ø
�‰Ð Ñ!×-Ñ-¨eÔ4Øˆ	r   c                 óž   — |€| j                   } t        |«      | fi |¤Ž}| j                  j                  |«       | j                  |_        |S )zy
        Helper for `.twinx`/`.twiny`/`.twin`.

        *kwargs* are forwarded to the parasite axes constructor.
        )rY   rZ   r.   r[   Ú_remove_any_twinr]   )r   r_   r   rr   s       r   r|   zHostAxesBase._add_twin_axesÇ   sQ   € ð ÐØ×.Ñ.ˆJØ4Ô(¨Ó4°TÑD¸VÑDˆØ�‰×Ñ˜bÔ!Ø ×1Ñ1ˆÔØˆ	r   c                 óV  — | j                   j                  |«       ddg}|j                  r|j                  d«       |j                  r|j                  d«       | j                  t        |«         j                  d«       | j                  t        |«         j                  dd¬«       y )Nry   rw   TF)Ú
ticklabelsÚlabel)r.   r\   Ú_sharexÚ_shareyr}   Útupler~   Útoggle)r   rr   Úrestores      r   r‰   zHostAxesBase._remove_any_twinÔ   s   € Ø�‰×Ñ˜bÔ!Ø˜'Ð"ˆØ�:Š:Ø�N‰N˜5Ô!Ø�:Š:Ø�N‰N˜7Ô#Ø�	‰	”%˜“.Ñ!×-Ñ-¨dÔ3Ø�	‰	”%˜“.Ñ!×(Ñ(°EÀÐ(ÕGr   T©Úcall_axes_locatorÚbbox_extra_artistsc                ó  •— g | j                   D �cg c]  }|j                  ||¬«      ‘Œ c}¢t        ‰| �  |||¬«      ‘}t        j                  |D �cg c]#  }|j
                  dk7  s|j                  dk7  sŒ"|‘Œ% c}«      S c c}w c c}w )N)r“   r’   r   )r.   Úget_tightbboxr   r   ÚunionÚwidthÚheight)r   rm   r“   r”   rr   ÚbbsÚbr   s          €r   r–   zHostAxesBase.get_tightbboxÞ   sš   ø€ ðJàŸ™ö(Øð ×Ñ˜xÐ;LÐÕMò (ðJô ‰GÑ! (Ø4EØ5Gð "ó IðJˆô �z‰z cÖK ¨Q¯W©W¸ª\¸Q¿X¹XÈ»]š1ÒKÓLÐLùò(ùò
 Ls   ‘BÁ#BÁ8B)Nr?   Nr*   )NN)rO   rP   rQ   r   rb   rl   r    r/   r€   rƒ   r‡   r|   r‰   r–   rR   rS   s   @r   rU   rU   S   sT   ø„ ô*ð
 =Aó$ôL/ô&ô
óóóò òHðMÀØ)-÷Mò Mr   rU   z
{}HostAxesrY   )r_   Úfigurec                 ó†   — ddl m} t        | «      }|€|j                  «       } ||g|¢­i |¤Ž}|j	                  |«       |S )aP  
    Create axes that can act as a hosts to parasitic axes.

    Parameters
    ----------
    figure : `~matplotlib.figure.Figure`
        Figure to which the axes will be added. Defaults to the current figure
        `.pyplot.gcf()`.

    *args, **kwargs
        Will be passed on to the underlying `~.axes.Axes` object creation.
    r   N)Úmatplotlib.pyplotÚpyplotÚhost_axes_class_factoryÚgcfÚadd_axes)r_   rœ   rW   r   ÚpltÚhost_axes_classrr   s          r   Ú	host_axesr¥   î   sF   € õ $Ü-¨jÓ9€OØ€~Ø—‘“ˆÙ	˜Ð	1 $Ò	1¨&Ñ	1€BØ
‡O�O�BÔØ€Ir   )Ú
matplotlibr   r   Úmatplotlib.artistÚartistr!   Úmatplotlib.transformsÚ
transformsr8   r   Úmpl_axesr   r	   Ú_make_class_factoryrZ   ÚParasiteAxesrU   r    Úhost_subplot_class_factoryÚHostAxesÚSubplotHostr¥   Úhost_subplot© r   r   ú<module>r³      s›   ðß "Ý #Ý +Ý &Ý ÷AHñ AHðL 8˜e×7Ñ7Ø�ló$Ð á*¨4Ó0€÷SMñ SMðn €E×Ñ˜l¨LÐ:LÓMðNÐ Ð4á0°Ó6Ð 6€ˆ;ð !%¨Tô ð, �r   