§
    ‡ÛgŽ$  ã                   ó  — 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dS )é    )Ú_apiÚcbookN)ÚBboxé   )ÚAxesc                   óV   ‡ — e Zd Zd
ddœˆ fd„Zˆ fd„Zˆ fd„Zˆ fd„Zd„ Zd„ Zd	„ Z	ˆ xZ
S )ÚParasiteAxesBaseN)Úviewlim_modec                ó¢   •— || _         || _        |                      |¦  «         d|d<    t          ¦   «         j        |j        |j        fi |¤Ž d S )NFÚframeon)Ú_parent_axesÚtransAuxÚset_viewlim_modeÚsuperÚ__init__ÚfigureÚ	_position)ÚselfÚparent_axesÚaux_transformr
   ÚkwargsÚ	__class__s        €ú[/granary/edev/quantum/lib/python3.11/site-packages/mpl_toolkits/axes_grid1/parasite_axes.pyr   zParasiteAxesBase.__init__
   s]   ø€ à'ˆÔØ%ˆŒØ×Ò˜lÑ+Ô+Ð+Ø!ˆˆyÑØ�‰ŒÔ˜Ô+¨[Ô-BÐMÐMÀfÐMÐMÐMÐMÐMó    c                 óN  •— t          ¦   «                              ¦   «          t          j        |                      ¦   «         d¬¦  «         | j        j        | _        | j        j                             d| j	        ¦  «         | j        j                             d| j	        ¦  «         d S )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Ñ8Ô8Ð8ØÔ+Ô6ˆŒØÔÔ#×6Ò6Ø˜DœOñ	-ô 	-ð 	-àÔÔ#×6Ò6Ø˜DœOñ	-ô 	-ð 	-ð 	-ð 	-r   c                 óè   •— t          ¦   «                              |¦  «         |                      ¦   «         D ]:}t          |j        d¦  «        r#| |j        j        v r|                     |¦  «         Œ;d S )NÚ	parasites)r   Úpickr"   ÚhasattrÚinaxesr)   ©r   Ú
mouseeventÚar   s      €r   r*   zParasiteAxesBase.pick   s{   ø€ õ 	‰Œ�Š�ZÑ Ô Ð ð ×"Ò"Ñ$Ô$ð 	#ð 	#ˆAÝ˜
Ô)¨;Ñ7Ô7ð #Ø 
Ô 1Ô ;Ð;Ð;Ø—’�zÑ"Ô"Ð"øð	#ð 	#r   c                 ó>  •— | j         �t| j        j        | _        | j         | j        j        z   | _        t	          j        | j        | j        ¦  «        | _        t	          j        | j        | j        ¦  «        | _        d S t          ¦   «          	                    ¦   «          d S ©N)
r   r   Ú	transAxesÚ	transDataÚmtransformsÚblended_transform_factoryÚ_xaxis_transformÚ_yaxis_transformr   Ú_set_lim_and_transformsr'   s    €r   r8   z(ParasiteAxesBase._set_lim_and_transforms)   sŒ   ø€ ØŒ=Ð$Ø!Ô.Ô8ˆDŒNØ!œ]¨TÔ->Ô-HÑHˆDŒNÝ$/Ô$IØ” ¤ñ%0ô %0ˆDÔ!å$/Ô$IØ” ¤ñ%0ô %0ˆDÔ!Ð!Ð!õ ‰GŒG×+Ò+Ñ-Ô-Ð-Ð-Ð-r   c                 óD   — t          j        g d¢|¬¦  «         || _        d S )N©NÚequalÚ	transform©Úmode)r   Úcheck_in_listÚ_viewlim_mode)r   r>   s     r   r   z!ParasiteAxesBase.set_viewlim_mode4   s-   € ÝÔÐ7Ð7Ð7¸dÐCÑCÔCÐCØ!ˆÔÐÐr   c                 ó   — | j         S r1   )r@   )r   s    r   Úget_viewlim_modez!ParasiteAxesBase.get_viewlim_mode8   s   € ØÔ!Ð!r   c                 ót  — |j                              ¦   «         }|                      ¦   «         }|€d S |dk    r| j                              |¦  «         d S |dk    rF| j                              |                     | j                             ¦   «         ¦  «        ¦  «         d S t          j        g d¢|¬¦  «         d S )Nr;   r<   r:   r=   )	ÚviewLimÚfrozenrB   ÚsetÚtransformedr   Úinvertedr   r?   )r   ÚparentÚviewlimr>   s       r   r&   zParasiteAxesBase._sync_lims;   s»   € Ø”.×'Ò'Ñ)Ô)ˆØ×$Ò$Ñ&Ô&ˆØˆ<ØˆDØ�WŠ_ˆ_ØŒL×Ò˜WÑ%Ô%Ð%Ð%Ð%Ø�[Ò Ð ØŒL×Ò˜W×0Ò0°´×1GÒ1GÑ1IÔ1IÑJÔJÑKÔKÐKÐKÐKåÔÐ;Ð;Ð;À$ÐGÑGÔGÐGÐGÐGr   r1   )Ú__name__Ú
__module__Ú__qualname__r   r   r*   r8   r   rB   r&   Ú__classcell__©r   s   @r   r	   r	      sÑ   ø€ € € € € ðNØ!%ðNð Nð Nð Nð Nð Nð Nð-ð -ð -ð -ð -ð
#ð 
#ð 
#ð 
#ð 
#ð	.ð 	.ð 	.ð 	.ð 	.ð"ð "ð "ð"ð "ð "ð
Hð 
Hð 
Hð 
Hð 
Hð 
Hð 
Hr   r	   z
{}Parasitec                   óz   ‡ — 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ˆ fd„	Zˆ xZS )ÚHostAxesBasec                 óH   •— g | _          t          ¦   «         j        |i |¤Ž d S r1   )r)   r   r   )r   Úargsr   r   s      €r   r   zHostAxesBase.__init__P   s,   ø€ ØˆŒØ�‰ŒÔ˜$Ð) &Ð)Ð)Ð)Ð)Ð)r   Nr;   c                 ó¤   — |€| j         }t          |¦  «        } || |fd|i|¤Ž}| j                             |¦  «         | j        j        |_        |S )ab  
        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.
        Nr
   )Ú_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_axesT   sv   € ð6 ÐØÔ.ˆJÝ9¸*ÑEÔEÐØ!Ð!Ø�"ð;ð ;Ø#/ð;Ø39ð;ð ;ˆð 	Œ×Ò˜cÑ"Ô"Ð"Ø!œ^Ô2ˆÔØˆ
r   c                 ó
  •— t          | j        ¦  «        }|                      ¦   «         }|r9 || |¦  «        }|                      |d¬¦  «         |                      |¦  «         n|                      ¦   «          |                      ¦   «         }| j        D ]C}|                     |¦  «         | j                             |                     ¦   «         ¦  «         ŒDt          ¦   «          
                    |¦  «         | j        |d …= d S )NÚactive)Úwhich)ÚlenÚ	_childrenÚget_axes_locatorÚset_positionÚapply_aspectÚget_positionr)   Úextendr"   r   Údraw)r   ÚrendererÚorig_children_lenÚlocatorÚposÚrectÚaxr   s          €r   ri   zHostAxesBase.drawz   s  ø€ Ý ¤Ñ/Ô/Ðà×'Ò'Ñ)Ô)ˆØð 	 Ø�'˜$ Ñ)Ô)ˆCØ×Ò˜c¨ÐÑ2Ô2Ð2Ø×Ò˜cÑ"Ô"Ð"Ð"à×ÒÑÔÐà× Ò Ñ"Ô"ˆØ”.ð 	5ð 	5ˆBØ�OŠO˜DÑ!Ô!Ð!ØŒN×!Ò! "§/¢/Ñ"3Ô"3Ñ4Ô4Ð4Ð4å‰Œ�Š�XÑÔÐØŒNÐ,Ð-Ð-Ð.Ð.Ð.r   c                 ó„   •— t          ¦   «                              ¦   «          | j        D ]}|                     ¦   «          Œd S r1   )r   r   r)   )r   ro   r   s     €r   r   zHostAxesBase.clear�   s>   ø€ Ý‰Œ�Š‰ŒˆØ”.ð 	ð 	ˆBØ�HŠH‰JŒJˆJˆJð	ð 	r   c                 óˆ   •— t          ¦   «                              |¦  «         | j        D ]}|                     |¦  «         Œd S r1   )r   r*   r)   r-   s      €r   r*   zHostAxesBase.pick’   sK   ø€ Ý‰Œ�Š�ZÑ Ô Ð ð ”ð 	ð 	ˆAØ�FŠF�:ÑÔÐÐð	ð 	r   c                 óô   — |                       || ¬¦  «        }| j        d                              d¦  «         |j        d                              d¦  «         |j        d                              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[   ro   s      r   ÚtwinxzHostAxesBase.twinx™   ss   € ð × Ò  °DÐ Ñ9Ô9ˆØŒ	�'Ô×&Ò& uÑ-Ô-Ð-Ø
Œ�Ô×$Ò$ TÑ*Ô*Ð*Ø
ŒÐ'Ô(×4Ò4°UÑ;Ô;Ð;Øˆ	r   c                 óô   — |                       || ¬¦  «        }| j        d                              d¦  «         |j        d                              d¦  «         |j        d                              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.
        )Úshareyrv   FT)ru   rt   rw   rx   r|   s      r   ÚtwinyzHostAxesBase.twiny¦   sr   € ð × Ò  °DÐ Ñ9Ô9ˆØŒ	�%Ô×$Ò$ UÑ+Ô+Ð+Ø
Œ�Œ×"Ò" 4Ñ(Ô(Ð(Ø
ŒÐ)Ô*×6Ò6°uÑ=Ô=Ð=Øˆ	r   c                 ó   — |€t          j        ¦   «         }|                      ||d¬¦  «        }| j        d                              d¦  «         |j        d                              d¦  «         |j        d                              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.
        Nr<   )r   r
   )rv   rt   FT)ru   rw   )r4   ÚIdentityTransformry   rz   r{   )r   Ú	aux_transr[   ro   s       r   ÚtwinzHostAxesBase.twin³   s’   € ð ÐÝ#Ô5Ñ7Ô7ˆIØ× Ò Ø i¸kð !ñ Kô KˆàŒ	�.Ô!×-Ò-¨eÑ4Ô4Ð4Ø
Œ�Ô×+Ò+¨DÑ1Ô1Ð1Ø
ŒÐ Ô!×-Ò-¨eÑ4Ô4Ð4Øˆ	r   c                 ó�   — |€| j         } t          |¦  «        | fi |¤Ž}| j                             |¦  «         | j        |_        |S )zy
        Helper for `.twinx`/`.twiny`/`.twin`.

        *kwargs* are forwarded to the parasite axes constructor.
        )rU   rV   r)   rW   Ú_remove_any_twinrY   )r   r[   r   ro   s       r   ry   zHostAxesBase._add_twin_axesÃ   sX   € ð ÐØÔ.ˆJØ4Õ(¨Ñ4Ô4°TÐDÐD¸VÐDÐDˆØŒ×Ò˜bÑ!Ô!Ð!Ø Ô1ˆÔØˆ	r   c                 ój  — | j                              |¦  «         ddg}|j        r|                     d¦  «         |j        r|                     d¦  «         | j        t          |¦  «                                      d¦  «         | j        t          |¦  «                                      dd¬¦  «         d S )Nrv   rt   TF)Ú
ticklabelsÚlabel)r)   rX   Ú_sharexÚ_shareyrz   Útupler{   Útoggle)r   ro   Úrestores      r   r†   zHostAxesBase._remove_any_twinÐ   s§   € ØŒ×Ò˜bÑ!Ô!Ð!Ø˜'Ð"ˆØŒ:ð 	"Ø�NŠN˜5Ñ!Ô!Ð!ØŒ:ð 	$Ø�NŠN˜7Ñ#Ô#Ð#ØŒ	•%˜‘.”.Ô!×-Ò-¨dÑ3Ô3Ð3ØŒ	•%˜‘.”.Ô!×(Ò(°EÀÐ(ÑGÔGÐGÐGÐGr   Tc                 ó¸   •‡‡— g ˆˆfd„| j         D ¦   «         ¢t          ¦   «                              ‰‰|¬¦  «        ‘}t          j        d„ |D ¦   «         ¦  «        S )Nc                 ó>   •— g | ]}|                      ‰‰¬ ¦  «        ‘ŒS ))Úcall_axes_locator)Úget_tightbbox)Ú.0ro   r‘   rj   s     €€r   ú
<listcomp>z.HostAxesBase.get_tightbbox.<locals>.<listcomp>Ý   s=   ø€ ð (ð (ð (Øð ×Ò˜xÐ;LÐÑMÔMð (ð (ð (r   )r‘   Úbbox_extra_artistsc                 ó>   — g | ]}|j         d k    s|j        d k    ¯|‘ŒS )r   )ÚwidthÚheight)r“   Úbs     r   r”   z.HostAxesBase.get_tightbbox.<locals>.<listcomp>â   s)   € ÐKÐKÐK ¨Q¬W¸ª\¨\¸Q¼XÈº]¸]˜1¸]¸]¸]r   )r)   r   r’   r   Úunion)r   rj   r‘   r•   Úbbsr   s    ``  €r   r’   zHostAxesBase.get_tightbboxÚ   s�   øøø€ ðJð(ð (ð (ð (ð (Øœð(ñ (ô (ðJõ ‰GŒG×!Ò! (Ø4EØ5Gð "ñ Iô IðJˆõ ŒzÐKÐK cÐKÑKÔKÑLÔLÐLr   )Nr;   Nr1   )NN)NTN)rK   rL   rM   r   r^   ri   r   r*   r}   r€   r„   ry   r†   r’   rN   rO   s   @r   rQ   rQ   O   s,  ø€ € € € € ð*ð *ð *ð *ð *ð
 =Að$ð $ð $ð $ðL/ð /ð /ð /ð /ð&ð ð ð ð ð
ð ð ð ð ðð ð ð ðð ð ð ðð ð ð ð ð ð ðHð Hð Hð >BØ)-ðMð Mð Mð Mð Mð Mð Mð Mð Mð Mr   rQ   z
{}HostAxesrU   )r[   r   c                 óž   — ddl m} t          | ¦  «        }|€|                     ¦   «         } ||g|¢R i |¤Ž}|                     |¦  «         |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   rS   r   ÚpltÚhost_axes_classro   s          r   Ú	host_axesr¤   ê   sk   € ð $Ð#Ð#Ð#Ð#Ð#Ý-¨jÑ9Ô9€OØ€~Ø—’‘”ˆØ	ˆ˜Ð	1 $Ð	1Ð	1Ð	1¨&Ð	1Ð	1€BØ
‡O‚O�BÑÔÐØ€Ir   )Ú
matplotlibr   r   Úmatplotlib.artistÚartistr    Úmatplotlib.transformsÚ
transformsr4   r   Úmpl_axesr   r	   Ú_make_class_factoryrV   ÚParasiteAxesrQ   rŸ   Úhost_subplot_class_factoryÚHostAxesÚSubplotHostr¤   Úhost_subplot© r   r   ú<module>r²      s^  ðØ "Ð "Ð "Ð "Ð "Ð "Ð "Ð "Ø #Ð #Ð #Ð #Ð #Ð #Ø +Ð +Ð +Ð +Ð +Ð +Ø &Ð &Ð &Ð &Ð &Ð &Ø Ð Ð Ð Ð Ð ð=Hð =Hð =Hð =Hð =Hñ =Hô =Hð =HðD 8˜eÔ7Ø�lñ$ô $Ð à*Ð*¨4Ñ0Ô0€ðSMð SMð SMð SMð SMñ SMô SMð SMðn €EÔ˜l¨LÐ:LÑMÔMðNÐ Ð4à0Ð0°Ñ6Ô6Ð 6€ˆ;ð !%¨Tð ð ð ð ð ð, €€€r   