§
    †Ûgea ã                   óÄ  — d Z ddlmZ ddlZddlZddlmZmZ ddlmZ ddl	Z
ddlZddlmZmZmZmZmZmZmZmZmZ ddlmZ dd	lmZmZmZmZ dd
lmZm Z   G d„ d¦  «        Z! G d„ d¦  «        Z" G d„ de"¦  «        Z# G d„ de#¦  «        Z$ G d„ de#¦  «        Z% G d„ de%¦  «        Z& G d„ de%¦  «        Z'd„ Z( G d„ de#¦  «        Z) G d„ de#¦  «        Z* G d„ de#¦  «        Z+ G d „ d!e"¦  «        Z, G d"„ d#e#¦  «        Z- G d$„ d%e"¦  «        Z. G d&„ d'e#¦  «        Z/ G d(„ d)e/¦  «        Z0 G d*„ d+¦  «        Z1 G d,„ d-¦  «        Z2d.Z3 ej4        e3 5                    d/d0¦  «        ¦  «         G d1„ d2e/¦  «        ¦   «         Z6 ej4        e3 5                    d/d3¦  «        ¦  «         G d4„ d5e6¦  «        ¦   «         Z7 G d6„ d7e/¦  «        Z8 G d8„ d9e/¦  «        Z9 G d:„ d;e#¦  «        Z:dS )<a„  
GUI neutral widgets
===================

Widgets that are designed to work for any of the GUI backends.
All of these widgets require you to predefine a `matplotlib.axes.Axes`
instance and pass that as the first parameter.  Matplotlib doesn't try to
be too smart with respect to layout -- you will have to figure out how
wide and tall you want your Axes to be to accommodate your widget.
é    )Ú	ExitStackN)ÚIntegralÚNumber)Úcycleré   )	Ú_apiÚ
_docstringÚbackend_toolsÚcbookÚcollectionsÚcolorsÚtextÚtickerÚ
transforms)ÚLine2D)ÚCircleÚ	RectangleÚEllipseÚPolygon)ÚTransformedPatchPathÚAffine2Dc                   ó6   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	dS )	ÚLockDrawa®  
    Some widgets, like the cursor, draw onto the canvas, and this is not
    desirable under all circumstances, like when the toolbar is in zoom-to-rect
    mode and drawing a rectangle.  To avoid this, a widget can acquire a
    canvas' lock with ``canvas.widgetlock(widget)`` before drawing on the
    canvas; this will prevent other widgets from doing so at the same time (if
    they also try to acquire the lock first).
    c                 ó   — d | _         d S ©N©Ú_owner©Úselfs    úH/granary/edev/quantum/lib/python3.11/site-packages/matplotlib/widgets.pyÚ__init__zLockDraw.__init__&   s   € ØˆŒˆˆó    c                 ó\   — |                       |¦  «        st          d¦  «        ‚|| _        dS )zReserve the lock for *o*.zalready lockedN©Ú	availableÚ
ValueErrorr   ©r   Úos     r    Ú__call__zLockDraw.__call__)   s0   € à�~Š~˜aÑ Ô ð 	/ÝÐ-Ñ.Ô.Ð.ØˆŒˆˆr"   c                 ó\   — |                       |¦  «        st          d¦  «        ‚d| _        dS )zRelease the lock from *o*.zyou do not own this lockNr$   r'   s     r    ÚreleasezLockDraw.release/   s0   € à�~Š~˜aÑ Ô ð 	9ÝÐ7Ñ8Ô8Ð8ØˆŒˆˆr"   c                 óV   — |                       ¦   «          p|                      |¦  «        S )z+Return whether drawing is available to *o*.)ÚlockedÚisownerr'   s     r    r%   zLockDraw.available5   s"   € à—;’;‘=”=Ð Ð3 D§L¢L°¡O¤OÐ3r"   c                 ó   — | j         |u S )z"Return whether *o* owns this lock.r   r'   s     r    r.   zLockDraw.isowner9   s   € àŒ{˜aÐÐr"   c                 ó   — | j         duS )z6Return whether the lock is currently held by an owner.Nr   r   s    r    r-   zLockDraw.locked=   s   € àŒ{ $Ð&Ð&r"   N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r!   r)   r+   r%   r.   r-   © r"   r    r   r      sx   € € € € € ðð ðð ð ðð ð ðð ð ð4ð 4ð 4ð ð  ð  ð'ð 'ð 'ð 'ð 'r"   r   c                   óR   — e Zd ZdZdZdZdZd„ Zd„ Z e	eed¬¦  «        Z
d„ Zd„ Zd	S )
ÚWidgetz6
    Abstract base class for GUI neutral widgets.
    Tc                 ó   — || _         dS )z!Set whether the widget is active.N©Ú_active)r   Úactives     r    Ú
set_activezWidget.set_activeJ   s   € àˆŒˆˆr"   c                 ó   — | j         S )z!Get whether the widget is active.r9   r   s    r    Ú
get_activezWidget.get_activeN   s
   € àŒ|Ðr"   zIs the widget active?)Údocc                 ó   — | j          S )z‰
        Return whether *event* should be ignored.

        This method should be called at the beginning of any event callback.
        )r;   ©r   Úevents     r    ÚignorezWidget.ignoreU   s   € ð ”;ˆÐr"   c                 ó2   — | j         | j        j        j         uS )aU  
        Someone has switched the canvas on us!

        This happens if `savefig` needs to save to a format the previous
        backend did not support (e.g. saving a figure using an Agg based
        backend saved to a vector format).

        Returns
        -------
        bool
           True if the canvas has been changed.

        )ÚcanvasÚaxÚfigurer   s    r    Ú_changed_canvaszWidget._changed_canvas]   s   € ð Œ{ $¤'¤.Ô"7Ð7Ð7r"   N)r1   r2   r3   r4   ÚdrawonÚeventsonr:   r<   r>   Úpropertyr;   rC   rH   r5   r"   r    r7   r7   B   s„   € € € € € ðð ð €FØ€HØ€Gðð ð ðð ð ð
 ˆX�j *Ð2IÐJÑJÔJ€Fðð ð ð8ð 8ð 8ð 8ð 8r"   r7   c                   ó$   — e Zd ZdZd„ Zd„ Zd„ ZdS )Ú
AxesWidgetaõ  
    Widget connected to a single `~matplotlib.axes.Axes`.

    To guarantee that the widget remains responsive and not garbage-collected,
    a reference to the object should be maintained by the user.

    This is necessary because the callback registry
    maintains only weak-refs to the functions, which are member
    functions of the widget.  If there are no references to the widget
    object it may be garbage collected which will disconnect the callbacks.

    Attributes
    ----------
    ax : `~matplotlib.axes.Axes`
        The parent Axes for the widget.
    canvas : `~matplotlib.backend_bases.FigureCanvasBase`
        The parent figure canvas for the widget.
    active : bool
        If False, the widget does not respond to events.
    c                 óD   — || _         |j        j        | _        g | _        d S r   )rF   rG   rE   Ú_cids)r   rF   s     r    r!   zAxesWidget.__init__„   s    € ØˆŒØ”iÔ&ˆŒØˆŒ
ˆ
ˆ
r"   c                 óp   — | j                              ||¦  «        }| j                             |¦  «         dS )zÆ
        Connect a callback function with an event.

        This should be used in lieu of ``figure.canvas.mpl_connect`` since this
        function stores callback ids for later clean up.
        N)rE   Úmpl_connectrO   Úappend)r   rB   ÚcallbackÚcids       r    Úconnect_eventzAxesWidget.connect_event‰   s7   € ð Œk×%Ò% e¨XÑ6Ô6ˆØŒ
×Ò˜#ÑÔÐÐÐr"   c                 óN   — | j         D ]}| j                             |¦  «         ŒdS )z-Disconnect all events created by this widget.N)rO   rE   Úmpl_disconnect)r   Úcs     r    Údisconnect_eventszAxesWidget.disconnect_events“   s6   € à”ð 	*ð 	*ˆAØŒK×&Ò& qÑ)Ô)Ð)Ð)ð	*ð 	*r"   N)r1   r2   r3   r4   r!   rU   rY   r5   r"   r    rM   rM   n   sK   € € € € € ðð ð*ð ð ð
ð ð ð*ð *ð *ð *ð *r"   rM   c                   óL   ‡ — e Zd ZdZ	 	 dddœˆ fd„Zd„ Zd	„ Zd
„ Zd„ Zd„ Z	ˆ xZ
S )ÚButtona¬  
    A GUI neutral button.

    For the button to remain responsive you must keep a reference to it.
    Call `.on_clicked` to connect to the button.

    Attributes
    ----------
    ax
        The `matplotlib.axes.Axes` the button renders into.
    label
        A `matplotlib.text.Text` instance.
    color
        The color of the button when not hovering.
    hovercolor
        The color of the button when hovering.
    Nú0.85ú0.95T)Úuseblitc                ó„  •— t          ¦   «                              |¦  «         |�|                     |¦  «         |                     dd|dd|j        ¬¦  «        | _        |o| j        j        | _        t          j
        dg¬¦  «        | _        |                      d| j        ¦  «         |                      d| j        ¦  «         |                      d	| j        ¦  «         |                     d
¦  «         |                     |¦  «         |                     g ¦  «         |                     g ¦  «         || _        || _        dS )aê  
        Parameters
        ----------
        ax : `~matplotlib.axes.Axes`
            The `~.axes.Axes` instance the button will be placed into.
        label : str
            The button text.
        image : array-like or PIL Image
            The image to place in the button, if not *None*.  The parameter is
            directly forwarded to `~matplotlib.axes.Axes.imshow`.
        color : color
            The color of the button when not activated.
        hovercolor : color
            The color of the button when the mouse is over it.
        useblit : bool, default: True
            Use blitting for faster drawing if supported by the backend.
            See the tutorial :doc:`/tutorials/advanced/blitting` for details.
        Nç      à?Úcenter)ÚverticalalignmentÚhorizontalalignmentÚ	transformÚclicked©ÚsignalsÚbutton_press_eventÚbutton_release_eventÚmotion_notify_eventF)Úsuperr!   Úimshowr   Ú	transAxesÚlabelrE   Úsupports_blitÚ_useblitr   ÚCallbackRegistryÚ
_observersrU   Ú_clickÚ_releaseÚ_motionÚset_navigateÚset_facecolorÚ
set_xticksÚ
set_yticksÚcolorÚ
hovercolor)r   rF   rn   Úimagerz   r{   r^   Ú	__class__s          €r    r!   zButton.__init__¬   s1  ø€ õ( 	‰Œ×Ò˜ÑÔÐàÐØ�IŠI�eÑÔÐØ—W’W˜S # uØ/7Ø19Ø')¤|ð ñ 5ô 5ˆŒ
ð
  Ð= D¤KÔ$=ˆŒåÔ0¸)¸ÐEÑEÔEˆŒà×ÒÐ/°´Ñ=Ô=Ð=Ø×ÒÐ1°4´=ÑAÔAÐAØ×ÒÐ0°$´,Ñ?Ô?Ð?Ø
�Š˜ÑÔÐØ
×Ò˜ÑÔÐØ
�Š�bÑÔÐØ
�Š�bÑÔÐØˆŒ
Ø$ˆŒˆˆr"   c                 óÎ   — |                       |¦  «        s|j        | j        k    s| j        sd S |j        j        | j        k    r!|j                             | j        ¦  «         d S d S r   )rC   ÚinaxesrF   rJ   rE   Úmouse_grabberÚ
grab_mouserA   s     r    rs   zButton._click×   sh   € Ø�;Š;�uÑÔð 	 ¤°´Ò!8Ð!8ÀÄÐ!8ØˆFØŒ<Ô%¨¬Ò0Ð0ØŒL×#Ò# D¤GÑ,Ô,Ð,Ð,Ð,ð 1Ð0r"   c                 ó  — |                       |¦  «        s|j        j        | j        k    rd S |j                             | j        ¦  «         | j        r-|j        | j        k    r| j                             d|¦  «         d S d S d S )Nre   )	rC   rE   r€   rF   Úrelease_mouserJ   r   rr   ÚprocessrA   s     r    rt   zButton._releaseÝ   sŠ   € Ø�;Š;�uÑÔð 	 ¤Ô!;¸t¼wÒ!FÐ!FØˆFØŒ×"Ò" 4¤7Ñ+Ô+Ð+ØŒ=ð 	6˜Uœ\¨T¬WÒ4Ð4ØŒO×#Ò# I¨uÑ5Ô5Ð5Ð5Ð5ð	6ð 	6Ð4Ð4r"   c                 óÜ  — |                       |¦  «        rd S |j        | j        k    r| j        n| j        }t          j        || j                             ¦   «         ¦  «        sˆ| j                             |¦  «         | j	        ri| j
        rE| j                             | j        ¦  «         | j                             | j        j        ¦  «         d S | j                             ¦   «          d S d S d S r   )rC   r   rF   r{   rz   r   Ú
same_colorÚget_facecolorrw   rI   rp   Údraw_artistrE   ÚblitÚbboxÚdraw©r   rB   rX   s      r    ru   zButton._motionä   sé   € Ø�;Š;�uÑÔð 	ØˆFØ$œ|¨t¬wÒ6Ð6ˆDŒOˆO¸D¼JˆÝÔ   D¤G×$9Ò$9Ñ$;Ô$;Ñ<Ô<ð 	'ØŒG×!Ò! !Ñ$Ô$Ð$ØŒ{ð 'Ø”=ð 'Ø”G×'Ò'¨¬Ñ0Ô0Ð0Ø”K×$Ò$ T¤W¤\Ñ2Ô2Ð2Ð2Ð2à”K×$Ò$Ñ&Ô&Ð&Ð&Ð&ð	'ð 	'ð'ð 'r"   c                 ó@   ‡— | j                              dˆfd„¦  «        S )úž
        Connect the callback function *func* to button click events.

        Returns a connection id, which can be used to disconnect the callback.
        re   c                 ó   •—  ‰| ¦  «        S r   r5   )rB   Úfuncs    €r    ú<lambda>z#Button.on_clicked.<locals>.<lambda>÷   s   ø€ ÀÀÀUÁÄ€ r"   ©rr   Úconnect©r   r�   s    `r    Ú
on_clickedzButton.on_clickedñ   s'   ø€ ð Œ×&Ò& yÐ2KÐ2KÐ2KÐ2KÑLÔLÐLr"   c                 ó:   — | j                              |¦  «         dS )z6Remove the callback function with connection id *cid*.N©rr   Ú
disconnect©r   rT   s     r    r˜   zButton.disconnectù   ó   € àŒ×"Ò" 3Ñ'Ô'Ð'Ð'Ð'r"   )Nr\   r]   )r1   r2   r3   r4   r!   rs   rt   ru   r•   r˜   Ú__classcell__©r}   s   @r    r[   r[   ™   s«   ø€ € € € € ðð ð$ )-Ø*0ð)%Ø=Að)%ð )%ð )%ð )%ð )%ð )%ð )%ðV-ð -ð -ð6ð 6ð 6ð'ð 'ð 'ðMð Mð Mð(ð (ð (ð (ð (ð (ð (r"   r[   c                   ó4   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zd„ Zˆ xZS )Ú
SliderBasezª
    The base class for constructing Slider widgets. Not intended for direct
    usage.

    For the slider to remain responsive you must maintain a reference to it.
    c
                 ó  •— |j         dk    rt          d¦  «        ‚t          ¦   «                              |¦  «         t	          j        ddg|¬¦  «         || _        || _        || _        || _	        || _
        |	| _        d| _        || _        |dk    r|                     ||f¦  «         |j        }
n|                     ||f¦  «         |j        }
|
                     ¦   «         | _        t)          | j        t*          j        ¦  «        s2t+          j        ¦   «         | _        | j                             |
¦  «         | j                             d¦  «         | j                             d¦  «         |                     ¦   «          |                     d¦  «         |                      d| j        ¦  «         |                      d	| j        ¦  «         |r|                      d
| j        ¦  «         t=          j        dg¬¦  «        | _         d S )NÚ3dz"Sliders cannot be added to 3D AxesÚ
horizontalÚvertical)ÚorientationFTrh   ri   rj   Úchangedrf   )!Únamer&   rk   r!   r   Úcheck_in_listr£   Ú	closedminÚ	closedmaxÚvalminÚvalmaxÚvalstepÚdrag_activeÚvalfmtÚset_ylimÚyaxisÚset_xlimÚxaxisÚget_major_formatterÚ_fmtÚ
isinstancer   ÚScalarFormatterÚset_axisÚset_useOffsetÚset_useMathTextÚset_axis_offrv   rU   Ú_updater   rq   rr   )r   rF   r£   r§   r¨   r©   rª   r­   Údraggingr«   Úaxisr}   s              €r    r!   zSliderBase.__init__  sà  ø€ àŒ7�dŠ?ˆ?ÝÐAÑBÔBÐBå‰Œ×Ò˜ÑÔÐÝÔ˜L¨*Ð5À;ÐOÑOÔOÐOà&ˆÔØ"ˆŒØ"ˆŒØˆŒØˆŒØˆŒØ ˆÔØˆŒà˜*Ò$Ð$Ø�KŠK˜ Ð(Ñ)Ô)Ð)Ø”8ˆDˆDà�KŠK˜ Ð(Ñ)Ô)Ð)Ø”8ˆDà×,Ò,Ñ.Ô.ˆŒ	Ý˜$œ)¥VÔ%;Ñ<Ô<ð 	%ÝÔ.Ñ0Ô0ˆDŒIØŒI×Ò˜tÑ$Ô$Ð$ØŒ	×Ò Ñ&Ô&Ð&ØŒ	×!Ò! $Ñ'Ô'Ð'à
�ŠÑÔÐØ
�Š˜ÑÔÐà×ÒÐ/°´Ñ>Ô>Ð>Ø×ÒÐ1°4´<Ñ@Ô@Ð@Øð 	DØ×ÒÐ4°d´lÑCÔCÐCÝÔ0¸)¸ÐEÑEÔEˆŒˆˆr"   c                 ó|  — t          | j        t          ¦  «        r0| j        t	          || j        z
  | j        z  ¦  «        | j        z  z   }nq| j        �jt          j        | j        ¦  «        }|j        dk    rt          d|j        › �¦  «        ‚|t          j	        t          j
        ||z
  ¦  «        ¦  «                 }|S )z?Return *val* coerced to closest number in the ``valstep`` grid.Nr   z&valstep must have 1 dimension but has )r´   r«   r   r©   ÚroundÚnpÚ
asanyarrayÚndimr&   ÚargminÚabs)r   Úvalr«   s      r    Ú_stepped_valuezSliderBase._stepped_value-  s³   € å�d”l¥FÑ+Ô+ð 		<Ø”;Ý˜C $¤+Ñ-°´Ñ=Ñ>Ô>ÀÄÑMñNˆCˆCàŒ\Ð%Ý”m D¤LÑ1Ô1ˆGØŒ|˜qÒ Ð Ý ØK¸W¼\ÐKÐKñô ð ð �"œ)¥B¤F¨7°S©=Ñ$9Ô$9Ñ:Ô:Ô;ˆCØˆ
r"   c                 ó:   — | j                              |¦  «         dS )z±
        Remove the observer with connection id *cid*.

        Parameters
        ----------
        cid : int
            Connection id of the observer to be removed.
        Nr—   r™   s     r    r˜   zSliderBase.disconnect;  s    € ð 	Œ×"Ò" 3Ñ'Ô'Ð'Ð'Ð'r"   c                 ó‚   — t          j        | j        | j        k    ¦  «        r|                      | j        ¦  «         dS dS )z&Reset the slider to the initial value.N)r¿   ÚanyrÄ   ÚvalinitÚset_valr   s    r    ÚresetzSliderBase.resetF  sA   € åŒ6�$”(˜dœlÒ*Ñ+Ô+ð 	'Ø�LŠL˜œÑ&Ô&Ð&Ð&Ð&ð	'ð 	'r"   )	r1   r2   r3   r4   r!   rÅ   r˜   rË   r›   rœ   s   @r    rž   rž   þ   su   ø€ € € € € ðð ð&Fð &Fð &Fð &Fð &FðPð ð ð	(ð 	(ð 	(ð'ð 'ð 'ð 'ð 'ð 'ð 'r"   rž   c                   ó„   ‡ — e Zd ZdZ ej        dd¬¦  «        	 	 	 	 dd	d
ddœˆ fd„¦   «         Zd„ Zd„ Zd„ Z	d„ Z
d„ Zˆ xZS )ÚSlideraB  
    A slider representing a floating point range.

    Create a slider from *valmin* to *valmax* in Axes *ax*. For the slider to
    remain responsive you must maintain a reference to it. Call
    :meth:`on_changed` to connect to the slider event.

    Attributes
    ----------
    val : float
        Slider value.
    ú3.7rÉ   ©r¥   r`   NTr¡   ÚrÚ	lightgrey)Ú	initcolorÚtrack_colorÚhandle_stylec                óô  •— t          ¦   «                              |||||||||¦	  «	         |	�0t          |	d¦  «        s t          dt	          |	¦  «        › d�¦  «        ‚|
�0t          |
d¦  «        s t          dt	          |
¦  «        › d�¦  «        ‚|	| _        |
| _        |                      |¦  «        }|€|}|| _        || _	        dddd	œ}|€i n|}d
„ i |¥|¥ 
                    ¦   «         D ¦   «         }|dk    r‡t          ddd|j        |¬¦  «        | _        |                     | j        ¦  «          |j        ||ddfi |¤Ž| _        |                     |dd|dt%          | j        ¦  «        ¬¦  «        | _        dg|gg}n†t          ddd|j        |¬¦  «        | _        |                     | j        ¦  «          |j        ||ddfi |¤Ž| _        |                     |dd|dt%          | j        ¦  «        ¬¦  «        | _        |gdgg} |j        g |¢d‘R i |¤ddi¤Ž\  | _        |dk    r^|                     dd||j        dd¬¦  «        | _        |                     dd|                      |¦  «        |j        dd¬¦  «        | _        n]|                     dd||j        dd¬¦  «        | _        |                     dd|                      |¦  «        |j        dd¬¦  «        | _        |                      |¦  «         dS ) aN  
        Parameters
        ----------
        ax : Axes
            The Axes to put the slider in.

        label : str
            Slider label.

        valmin : float
            The minimum value of the slider.

        valmax : float
            The maximum value of the slider.

        valinit : float, default: 0.5
            The slider initial position.

        valfmt : str, default: None
            %-format string used to format the slider value.  If None, a
            `.ScalarFormatter` is used instead.

        closedmin : bool, default: True
            Whether the slider interval is closed on the bottom.

        closedmax : bool, default: True
            Whether the slider interval is closed on the top.

        slidermin : Slider, default: None
            Do not allow the current slider to have a value less than
            the value of the Slider *slidermin*.

        slidermax : Slider, default: None
            Do not allow the current slider to have a value greater than
            the value of the Slider *slidermax*.

        dragging : bool, default: True
            If True the slider can be dragged by the mouse.

        valstep : float or array-like, default: None
            If a float, the slider will snap to multiples of *valstep*.
            If an array the slider will snap to the values in the array.

        orientation : {'horizontal', 'vertical'}, default: 'horizontal'
            The orientation of the slider.

        initcolor : color, default: 'r'
            The color of the line at the *valinit* position. Set to ``'none'``
            for no line.

        track_color : color, default: 'lightgrey'
            The color of the background track. The track is accessible for
            further styling via the *track* attribute.

        handle_style : dict
            Properties of the slider handle. Default values are

            ========= ===== ======= ========================================
            Key       Value Default Description
            ========= ===== ======= ========================================
            facecolor color 'white' The facecolor of the slider handle.
            edgecolor color '.75'   The edgecolor of the slider handle.
            size      int   10      The size of the slider handle in points.
            ========= ===== ======= ========================================

            Other values will be transformed as marker{foo} and passed to the
            `~.Line2D` constructor. e.g. ``handle_style = {'style'='x'}`` will
            result in ``markerstyle = 'x'``.

        Notes
        -----
        Additional kwargs are passed on to ``self.poly`` which is the
        `~matplotlib.patches.Polygon` that draws the slider knob.  See the
        `.Polygon` documentation for valid property names (``facecolor``,
        ``edgecolor``, ``alpha``, etc.).
        NrÄ   zArgument slidermin (z) has no 'val'zArgument slidermax (Úwhiteú.75é
   ©Ú	facecolorÚ	edgecolorÚsizec                 ó    — i | ]\  }}d |› �|“ŒS ©Úmarkerr5   ©Ú.0ÚkÚvs      r    ú
<dictcomp>z#Slider.__init__.<locals>.<dictcomp>¿  ó1   € ð 
ð 
ð 
Ù $  1ˆL�QˆLˆL˜!ð
ð 
ð 
r"   r¢   ©ç      Ð?r   r`   r   ©rd   rÚ   rç   ç      è?r   )rz   ÚlwÚ	clip_path©r   rç   r(   Úclip_onFçR¸…ëQð?Úbottomra   ©rd   rb   rc   ç{®Gáz”¿ÚtopÚrightÚleft)rk   r!   Úhasattrr&   ÚtypeÚ	sliderminÚ	slidermaxÚ_value_in_boundsrÄ   rÉ   Úitemsr   rm   ÚtrackÚ	add_patchÚaxhspanÚpolyÚaxhliner   ÚhlineÚaxvspanÚaxvlineÚvlineÚplotÚ_handler   rn   Ú_formatÚvaltextrÊ   )r   rF   rn   r©   rª   rÉ   r­   r§   r¨   r÷   rø   r»   r«   r£   rÒ   rÓ   rÔ   ÚkwargsÚdefaultsÚmarker_propsÚhandleXYr}   s                        €r    r!   zSlider.__init__Z  sÍ  ø€ õd 	‰Œ×Ò˜˜[¨)°YØ ¨°¸7ñ	Dô 	Dð 	Dð Ð ­°¸EÑ)BÔ)BÐ ÝØF¥t¨I¡¤ÐFÐFÐFñHô Hð HàÐ ­°¸EÑ)BÔ)BÐ ÝØF¥t¨I¡¤ÐFÐFÐFñHô Hð Hà"ˆŒØ"ˆŒØ×'Ò'¨Ñ0Ô0ˆØˆ?ØˆGØˆŒØˆŒà!(°uÀbÐIÐIˆØ)Ð1�r�r°|ˆð
ð 
Ø(D¨8Ð(D°|Ð(D×(JÒ(JÑ(LÔ(Lð
ñ 
ô 
ˆð ˜*Ò$Ð$Ý"Ø˜"˜aØœ,Ø%ðñ ô ˆDŒJð
 �LŠL˜œÑ$Ô$Ð$Ø"˜œ
 6¨7°C¸ÐGÐGÀÐGÐGˆDŒIð Ÿš G¨Q°¸ÀqÝ.BÀ4Ä:Ñ.NÔ.Nð $ñ Pô PˆDŒJà˜ ˜yÐ)ˆHˆHå"Ø˜!˜RØœ,Ø%ðñ ô ˆDŒJð
 �LŠL˜œÑ$Ô$Ð$Ø"˜œ
 6¨7°C¸ÐGÐGÀÐGÐGˆDŒIØŸš G¨Q°¸ÀqÝ.BÀ4Ä:Ñ.NÔ.Nð $ñ Pô PˆDŒJà ˜	 C 5Ð)ˆHØ˜œð 
Øð
àð
ð 
ð 
ð ð
ð 
ð ð	
ð 
ð 
‰ˆŒð ˜*Ò$Ð$ØŸš  d¨E¸R¼\Ø3;Ø5=ð !ñ ?ô ?ˆDŒJð Ÿ7š7 3¨¨t¯|ª|¸GÑ/DÔ/DØ-/¬\Ø5:Ø7?ð #ñ Aô AˆDŒLˆLð
 Ÿš ¨¨U¸b¼lØ3;Ø5<ð !ñ >ô >ˆDŒJð Ÿ7š7 4¨¨d¯lªl¸7Ñ.CÔ.CØ-/¬\Ø5=Ø7=ð #ñ ?ô ?ˆDŒLð
 	�Š�WÑÔÐÐÐr"   c                 óN  — |                       |¦  «        }|| j        k    r| j        sdS | j        }n|| j        k    r| j        sdS | j        }| j        �%|| j        j        k    r| j        sdS | j        j        }| j        �%|| j        j        k    r| j        sdS | j        j        }|S )z&Makes sure *val* is with given bounds.N)rÅ   r©   r§   rª   r¨   r÷   rÄ   rø   ©r   rÄ   s     r    rù   zSlider._value_in_bounds÷  sÂ   € à×!Ò! #Ñ&Ô&ˆà�$”+ÒÐØ”>ð Ø�Ø”+ˆCˆCØ�D”KÒÐØ”>ð Ø�Ø”+ˆCàŒ>Ð%¨#°´Ô1CÒ*CÐ*CØ”>ð Ø�Ø”.Ô$ˆCàŒ>Ð%¨#°´Ô1CÒ*CÐ*CØ”>ð Ø�Ø”.Ô$ˆCØˆ
r"   c                 ó>  — |                       |¦  «        s|j        dk    rdS |j        dk    r6|j        | j        k    r&d| _        |j                             | j        ¦  «         | j        sdS |j        dk    s|j        dk    r8|j        | j        k    r(d| _        |j                             | j        ¦  «         dS | j	        dk    r|  
                    |j        ¦  «        }n|  
                    |j        ¦  «        }|d| j        fvr|                      |¦  «         dS dS )úUpdate the slider position.r   Nrh   Tri   Fr¢   )rC   Úbuttonr¥   r   rF   r¬   rE   r�   rƒ   r£   rù   ÚydataÚxdatarÄ   rÊ   )r   rB   rÄ   s      r    rº   zSlider._update  s/  € à�;Š;�uÑÔð 	 ¤°Ò!2Ð!2ØˆFàŒ:Ð-Ò-Ð-°%´,À$Ä'Ò2IÐ2IØ#ˆDÔØŒL×#Ò# D¤GÑ,Ô,Ð,àÔð 	ØˆFàŒzÐ3Ò3Ð3ØŒzÐ1Ò1Ð1ØŒ|˜tœwÒ&Ð&Ø$ˆDÔØŒL×&Ò& t¤wÑ/Ô/Ð/ØˆFØÔ˜zÒ)Ð)Ø×'Ò'¨¬Ñ4Ô4ˆCˆCà×'Ò'¨¬Ñ4Ô4ˆCØ�t˜TœXÐ&Ð&Ð&Ø�LŠL˜ÑÔÐÐÐð 'Ð&r"   c                 ó²   — | j         �
| j         |z  S | j                             | j        || j        g¦  «        \  }}}|| j                             ¦   «         z   S )úPretty-print *val*.©r­   r³   Úformat_ticksr©   rª   Ú
get_offset)r   rÄ   Ú_Úss       r    r  zSlider._format(  sV   € àŒ;Ð"Ø”; Ñ$Ð$à”i×,Ò,¨d¬k¸3ÀÄÐ-LÑMÔM‰GˆAˆq�!à�t”y×+Ò+Ñ-Ô-Ñ-Ð-r"   c                 óö  — | j         j        }| j        dk    r*d|f|d<   d|f|d<   | j                             |g¦  «         n)|df|d<   |df|d<   | j                             |g¦  «         || j         _        | j                             |                      |¦  «        ¦  «         | j	        r#| j
        j        j                             ¦   «          || _        | j        r| j                             d|¦  «         dS dS )	zg
        Set slider value to *val*.

        Parameters
        ----------
        val : float
        r¢   rç   r   ré   é   é   r¤   N)rþ   Úxyr£   r  Ú	set_ydataÚ	set_xdatar  Úset_textr  rI   rF   rG   rE   Ú	draw_idlerÄ   rJ   rr   r„   )r   rÄ   r  s      r    rÊ   zSlider.set_val1  s	  € ð ŒYŒ\ˆØÔ˜zÒ)Ð)Ø˜�HˆBˆq‰EØ˜�HˆBˆq‰EØŒL×"Ò" C 5Ñ)Ô)Ð)Ð)à˜�HˆBˆq‰EØ˜�HˆBˆq‰EØŒL×"Ò" C 5Ñ)Ô)Ð)ØˆŒ	ŒØŒ×Ò˜dŸlšl¨3Ñ/Ô/Ñ0Ô0Ð0ØŒ;ð 	.ØŒGŒNÔ!×+Ò+Ñ-Ô-Ð-ØˆŒØŒ=ð 	4ØŒO×#Ò# I¨sÑ3Ô3Ð3Ð3Ð3ð	4ð 	4r"   c                 ó@   ‡— | j                              dˆfd„¦  «        S )a€  
        Connect *func* as callback function to changes of the slider value.

        Parameters
        ----------
        func : callable
            Function to call when slider is changed.
            The function must accept a single float as its arguments.

        Returns
        -------
        int
            Connection id (which can be used to disconnect *func*).
        r¤   c                 ó   •—  ‰| ¦  «        S r   r5   ©rÄ   r�   s    €r    r‘   z#Slider.on_changed.<locals>.<lambda>Y  ó   ø€ ¸d¸dÀ3¹i¼i€ r"   r’   r”   s    `r    Ú
on_changedzSlider.on_changedJ  ó'   ø€ ð Œ×&Ò& yÐ2GÐ2GÐ2GÐ2GÑHÔHÐHr"   )	r`   NTTNNTNr¡   )r1   r2   r3   r4   r   Úmake_keyword_onlyr!   rù   rº   r  rÊ   r&  r›   rœ   s   @r    rÍ   rÍ   L  sá   ø€ € € € € ðð ð €TÔ˜E¨	Ð2Ñ2Ô2ØFJØ;?Ø8<Ø)ðZð 9<Ø(°tð	Zð Zð Zð Zð Zð Zñ 3Ô2ðZðxð ð ð0ð ð ð2.ð .ð .ð4ð 4ð 4ð2Ið Ið Ið Ið Ið Ið Ir"   rÍ   c                   ó¨   ‡ — e Zd ZdZ ej        dd¬¦  «        	 	 	 	 	 	 	 	 	 dˆ fd	„	¦   «         Zd
„ Zd„ Zd„ Z	d„ Z
d„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zˆ xZS )ÚRangeSlideraÑ  
    A slider representing a range of floating point values. Defines the min and
    max of the range via the *val* attribute as a tuple of (min, max).

    Create a slider that defines a range contained within [*valmin*, *valmax*]
    in Axes *ax*. For the slider to remain responsive you must maintain a
    reference to it. Call :meth:`on_changed` to connect to the slider event.

    Attributes
    ----------
    val : tuple of float
        Slider value.
    rÎ   rÉ   rÏ   NTr¡   rÑ   c                 ó€  •— t          ¦   «                              ||||||||	|
¦	  «	         ||f| _        |€(||z
  }t          j        ||dz  z   ||dz  z   g¦  «        }n|                      |¦  «        }|| _        || _        ddddœ}|€i n|}d„ i |¥|¥                     ¦   «         D ¦   «         }|d	k    rht          d
dd|j	        |¬¦  «        | _
        |                     | j
        ¦  «         | j                             d¬¦  «        }d|d         g}d|d         g}ngt          ddd|j	        |¬¦  «        | _
        |                     | j
        ¦  «         | j                             d¬¦  «        }|d         dg}|d         dg}t          t          j        ddg¦  «        fi |¤Ž| _         | j        |Ž  | j                             |¦  «         d| j                             ¦   «         _        | j                             | j        ¦  «         | j                             ¦   «           |j        g |¢d‘R i |¤ddi¤Žd          |j        g |¢d‘R i |¤ddi¤Žd         g| _        |d	k    r^|                     dd||j	        dd¬¦  «        | _        |                     dd|                      |¦  «        |j	        dd¬¦  «        | _        n]|                     dd||j	        dd¬¦  «        | _        |                     dd|                      |¦  «        |j	        dd¬¦  «        | _        d| _        |                      |¦  «         dS ) a 	  
        Parameters
        ----------
        ax : Axes
            The Axes to put the slider in.

        label : str
            Slider label.

        valmin : float
            The minimum value of the slider.

        valmax : float
            The maximum value of the slider.

        valinit : tuple of float or None, default: None
            The initial positions of the slider. If None the initial positions
            will be at the 25th and 75th percentiles of the range.

        valfmt : str, default: None
            %-format string used to format the slider values.  If None, a
            `.ScalarFormatter` is used instead.

        closedmin : bool, default: True
            Whether the slider interval is closed on the bottom.

        closedmax : bool, default: True
            Whether the slider interval is closed on the top.

        dragging : bool, default: True
            If True the slider can be dragged by the mouse.

        valstep : float, default: None
            If given, the slider will snap to multiples of *valstep*.

        orientation : {'horizontal', 'vertical'}, default: 'horizontal'
            The orientation of the slider.

        track_color : color, default: 'lightgrey'
            The color of the background track. The track is accessible for
            further styling via the *track* attribute.

        handle_style : dict
            Properties of the slider handles. Default values are

            ========= ===== ======= =========================================
            Key       Value Default Description
            ========= ===== ======= =========================================
            facecolor color 'white' The facecolor of the slider handles.
            edgecolor color '.75'   The edgecolor of the slider handles.
            size      int   10      The size of the slider handles in points.
            ========= ===== ======= =========================================

            Other values will be transformed as marker{foo} and passed to the
            `~.Line2D` constructor. e.g. ``handle_style = {'style'='x'}`` will
            result in ``markerstyle = 'x'``.

        Notes
        -----
        Additional kwargs are passed on to ``self.poly`` which is the
        `~matplotlib.patches.Polygon` that draws the slider knob.  See the
        `.Polygon` documentation for valid property names (``facecolor``,
        ``edgecolor``, ``alpha``, etc.).
        Nrç   ré   rÖ   r×   rØ   rÙ   c                 ó    — i | ]\  }}d |› �|“ŒS rÞ   r5   rà   s      r    rä   z(RangeSlider.__init__.<locals>.<dictcomp>Î  rå   r"   r¢   ræ   r`   r  rè   Úgrid)Úwhichr   r   rì   é   éd   r(   rí   Frî   rï   ra   rð   rñ   rò   ró   rô   )rk   r!   rÄ   r¿   Úarrayrù   rÉ   rú   r   rm   rû   rü   rF   Úget_yaxis_transformÚget_xaxis_transformr   Úzerosrþ   Ú_update_selection_polyÚset_transformÚget_pathÚ_interpolation_stepsÚ_request_autoscale_viewr  Ú_handlesr   rn   r  r  Ú_active_handlerÊ   )r   rF   rn   r©   rª   rÉ   r­   r§   r¨   r»   r«   r£   rÓ   rÔ   r  Úextentr	  r
  Úpoly_transformÚ
handleXY_1Ú
handleXY_2r}   s                        €r    r!   zRangeSlider.__init__k  s)  ø€ õd 	‰Œ×Ò˜˜[¨)°YØ ¨°¸7ñ	Dô 	Dð 	Dð ˜FÐ#ˆŒØˆ?à˜f‘_ˆFÝ”h ¨°$©Ñ 6Ø &¨°$©Ñ 6ð 8ñ 9ô 9ˆGˆGð ×+Ò+¨GÑ4Ô4ˆGØˆŒØˆŒà!(°uÀbÐIÐIˆØ)Ð1�r�r°|ˆð
ð 
Ø(D¨8Ð(D°|Ð(D×(JÒ(JÑ(LÔ(Lð
ñ 
ô 
ˆð ˜*Ò$Ð$Ý"Ø˜"˜aØœ,Ø%ðñ ô ˆDŒJð
 �LŠL˜œÑ$Ô$Ð$Ø!œW×8Ò8¸vÐ8ÑFÔFˆNØ˜g aœjÐ)ˆJØ˜g aœjÐ)ˆJˆJå"Ø˜!˜RØœ,Ø%ðñ ô ˆDŒJð
 �LŠL˜œÑ$Ô$Ð$Ø!œW×8Ò8¸vÐ8ÑFÔFˆNØ! !œ* bÐ)ˆJØ! !œ* bÐ)ˆJÝ�BœH a¨ VÑ,Ô,Ð7Ð7°Ð7Ð7ˆŒ	Ø#ˆÔ# WÐ-Ð-ØŒ	×Ò Ñ/Ô/Ð/Ø47ˆŒ	×ÒÑÔÔ1ØŒ×Ò˜$œ)Ñ$Ô$Ð$ØŒ×'Ò'Ñ)Ô)Ð)àˆBŒGð Øðàðð ð ð ðð ð ð	ð ð ð
 ôð ˆBŒGð Øðàðð ð ð ðð ð ð	ð ð ð
 ôð
ˆŒð ˜*Ò$Ð$ØŸšØØØØœ,Ø"*Ø$,ð !ñ ô ˆDŒJð Ÿ7š7ØØØ—’˜WÑ%Ô%Øœ,Ø"'Ø$,ð #ñ ô ˆDŒLˆLð ŸšØØØØœ,Ø"*Ø$+ð !ñ ô ˆDŒJð Ÿ7š7ØØØ—’˜WÑ%Ô%Øœ,Ø"*Ø$*ð #ñ ô ˆDŒLð #ˆÔØ�Š�WÑÔÐÐÐr"   c                 ó¼   — | j         j        }| j        dk    r#d|fx|d<   |d<   d|f|d<   d|f|d<   d|f|d<   d	S |dfx|d<   |d<   |df|d<   |df|d<   |df|d<   d	S )
zx
        Update the vertices of the *self.poly* slider in-place
        to cover the data range *vmin*, *vmax*.
        r¢   rç   r   é   r   ré   r  r  N)rþ   r  r£   )r   ÚvminÚvmaxÚvertss       r    r5  z"RangeSlider._update_selection_poly#  s�   € ð ”	”ˆØÔ˜zÒ)Ð)Ø"% t )Ð+ˆE�!‰H�u˜Q‘xØ˜D�yˆE�!‰HØ˜D�yˆE�!‰HØ˜D�yˆE�!‰HˆHˆHà"&¨ )Ð+ˆE�!‰H�u˜Q‘xØ˜S�yˆE�!‰HØ˜S�yˆE�!‰HØ˜S�yˆE�!‰HˆHˆHr"   c                 ó´   — || j         k    r| j        s| j        d         S | j         }|| j        d         k    r| j        d         }|                      |¦  «        S )z;Ensure the new min value is between valmin and self.val[1].r   r   )r©   r§   rÄ   rÅ   ©r   Úmins     r    Ú_min_in_boundszRangeSlider._min_in_bounds8  s\   € à�$”+ÒÐØ”>ð #Ø”x ”{Ð"Ø”+ˆCà�”˜!”ÒÐØ”(˜1”+ˆCØ×"Ò" 3Ñ'Ô'Ð'r"   c                 ó´   — || j         k    r| j        s| j        d         S | j         }|| j        d         k    r| j        d         }|                      |¦  «        S )z;Ensure the new max value is between valmax and self.val[0].r   r   )rª   r¨   rÄ   rÅ   ©r   Úmaxs     r    Ú_max_in_boundszRangeSlider._max_in_boundsC  s\   € à�$”+ÒÐØ”>ð #Ø”x ”{Ð"Ø”+ˆCà�$”(˜1”+ÒÐØ”(˜1”+ˆCØ×"Ò" 3Ñ'Ô'Ð'r"   c                 ón   — |                       |d         ¦  «        |                      |d         ¦  «        fS )z#Clip min, max values to the bounds.r   r   )rH  rL  )r   Úvalss     r    rù   zRangeSlider._value_in_boundsN  s1   € à×#Ò# D¨¤GÑ,Ô,¨d×.AÒ.AÀ$ÀqÄ'Ñ.JÔ.JÐKÐKr"   c                 ó°  — t          j        t          j        | j        |z
  ¦  «        ¦  «        }|dk    r+|                      |¦  «        }|                      |¦  «         n*|                      |¦  «        }|                      |¦  «         | j        rE| j	        dk    r| j         
                    |g¦  «         dS | j                             |g¦  «         dS dS )z2Update the slider value based on a given position.r   r¢   N)r¿   rÂ   rÃ   rÄ   rH  Úset_minrL  Úset_maxr;  r£   r  r  )r   ÚposÚidxrÄ   s       r    Ú_update_val_from_posz RangeSlider._update_val_from_posR  sØ   € åŒi�œ˜tœx¨#™~Ñ.Ô.Ñ/Ô/ˆØ�!Š8ˆ8Ø×%Ò% cÑ*Ô*ˆCØ�LŠL˜ÑÔÐÐà×%Ò% cÑ*Ô*ˆCØ�LŠL˜ÑÔÐØÔð 	5ØÔ :Ò-Ð-ØÔ#×-Ò-¨s¨eÑ4Ô4Ð4Ð4Ð4àÔ#×-Ò-¨s¨eÑ4Ô4Ð4Ð4Ð4ð		5ð 	5r"   c                 ó:  ‡— |                       ‰¦  «        s‰j        dk    rdS ‰j        dk    r6‰j        | j        k    r&d| _        ‰j                             | j        ¦  «         | j        sdS ‰j        dk    s‰j        dk    r?‰j        | j        k    r/d| _        ‰j                             | j        ¦  «         d| _	        dS | j
        dk    r8t          j        t          j        ˆfd„| j        D ¦   «         ¦  «        ¦  «        }n7t          j        t          j        ˆfd	„| j        D ¦   «         ¦  «        ¦  «        }| j        |         }|| j	        ur|| _	        | j
        dk    r|                      ‰j        ¦  «         dS |                      ‰j        ¦  «         dS )
r  r   Nrh   Tri   Fr¢   c                 óT   •— g | ]$}|                      ¦   «         d          ‰j        z
  ‘Œ%S ©r   )Ú	get_ydatar  ©rá   ÚhrB   s     €r    ú
<listcomp>z'RangeSlider._update.<locals>.<listcomp>x  ó-   ø€ ÐNÐNÐN¸1˜Ÿš™œ aÔ(¨5¬;Ñ6ÐNÐNÐNr"   c                 óT   •— g | ]$}|                      ¦   «         d          ‰j        z
  ‘Œ%S rW  )Ú	get_xdatar  rY  s     €r    r[  z'RangeSlider._update.<locals>.<listcomp>|  r\  r"   )rC   r  r¥   r   rF   r¬   rE   r�   rƒ   r;  r£   r¿   rÂ   rÃ   r:  rT  r  r  )r   rB   Úhandle_indexÚhandles    `  r    rº   zRangeSlider._updatea  sµ  ø€ à�;Š;�uÑÔð 	 ¤°Ò!2Ð!2ØˆFàŒ:Ð-Ò-Ð-°%´,À$Ä'Ò2IÐ2IØ#ˆDÔØŒL×#Ò# D¤GÑ,Ô,Ð,àÔð 		ØˆFàŒjÐ2Ò2Ð2ØŒJÐ.Ò.Ð.°5´<À4Ä7Ò3JÐ3Jà$ˆDÔØŒL×&Ò& t¤wÑ/Ô/Ð/Ø"&ˆDÔØˆFð Ô˜zÒ)Ð)Ýœ9Ý”ÐNÐNÐNÐNÀÄÐNÑNÔNÑOÔOñô ˆLˆLõ œ9Ý”ÐNÐNÐNÐNÀÄÐNÑNÔNÑOÔOñô ˆLð ”˜|Ô,ˆð ˜Ô,Ð,Ð,Ø"(ˆDÔàÔ˜zÒ)Ð)Ø×%Ò% e¤kÑ2Ô2Ð2Ð2Ð2à×%Ò% e¤kÑ2Ô2Ð2Ð2Ð2r"   c                 ó8  — | j         �%d| j         |d         z  › d| j         |d         z  › d�S | j                             | j        g|¢| j        ‘¦  «        \  }}}}|| j                             ¦   «         z  }|| j                             ¦   «         z  }d|› d|› d�S )r  Nú(r   z, r   ú)r  )r   rÄ   r  Ús1Ús2s        r    r  zRangeSlider._formatŠ  s²   € àŒ;Ð"ØF�t”{ S¨¤VÑ+ÐFÐF¨t¬{¸SÀ¼VÑ/CÐFÐFÐFÐFàœ9×1Ò1Ø”Ð0˜sÐ0 D¤KÐ0ñô ‰LˆAˆr�2�qð �$”)×&Ò&Ñ(Ô(Ñ(ˆBØ�$”)×&Ò&Ñ(Ô(Ñ(ˆBà"�r�?�?˜R�?�?�?Ð"r"   c                 óJ   — |                       || j        d         f¦  «         dS )zx
        Set the lower value of the slider to *min*.

        Parameters
        ----------
        min : float
        r   N©rÊ   rÄ   rF  s     r    rP  zRangeSlider.set_min˜  s'   € ð 	�Š�c˜4œ8 Aœ;Ð'Ñ(Ô(Ð(Ð(Ð(r"   c                 óJ   — |                       | j        d         |f¦  «         dS )zx
        Set the lower value of the slider to *max*.

        Parameters
        ----------
        max : float
        r   Nrg  rJ  s     r    rQ  zRangeSlider.set_max¢  s'   € ð 	�Š�d”h˜q”k 3Ð'Ñ(Ô(Ð(Ð(Ð(r"   c                 ó  — t          j        |¦  «        }t          j        d|¬¦  «         | j        | j        f| _        |                      |¦  «        \  }}|                      ||¦  «         | j	        dk    rC| j
        d                              |g¦  «         | j
        d                              |g¦  «         nB| j
        d                              |g¦  «         | j
        d                              |g¦  «         | j                             |                      ||f¦  «        ¦  «         | j        r#| j        j        j                             ¦   «          ||f| _        | j        r| j                             d||f¦  «         dS dS )z~
        Set slider value to *val*.

        Parameters
        ----------
        val : tuple or array-like of float
        )r  )rÄ   r¢   r   r   r¤   N)r¿   Úsortr   Úcheck_shaper©   rª   rÄ   rù   r5  r£   r:  r  r  r  r   r  rI   rF   rG   rE   r!  rJ   rr   r„   )r   rÄ   rB  rC  s       r    rÊ   zRangeSlider.set_val¬  ss  € õ Œg�c‰lŒlˆÝÔ˜ 3Ð'Ñ'Ô'Ð'à”K ¤Ð-ˆŒØ×*Ò*¨3Ñ/Ô/‰
ˆˆdØ×#Ò# D¨$Ñ/Ô/Ð/ØÔ˜zÒ)Ð)ØŒM˜!Ô×&Ò&¨ vÑ.Ô.Ð.ØŒM˜!Ô×&Ò&¨ vÑ.Ô.Ð.Ð.àŒM˜!Ô×&Ò&¨ vÑ.Ô.Ð.ØŒM˜!Ô×&Ò&¨ vÑ.Ô.Ð.àŒ×Ò˜dŸlšl¨D°$¨<Ñ8Ô8Ñ9Ô9Ð9àŒ;ð 	.ØŒGŒNÔ!×+Ò+Ñ-Ô-Ð-Ø˜$�<ˆŒØŒ=ð 	=ØŒO×#Ò# I°°d¨|Ñ<Ô<Ð<Ð<Ð<ð	=ð 	=r"   c                 ó@   ‡— | j                              dˆfd„¦  «        S )a„  
        Connect *func* as callback function to changes of the slider value.

        Parameters
        ----------
        func : callable
            Function to call when slider is changed. The function
            must accept a 2-tuple of floats as its argument.

        Returns
        -------
        int
            Connection id (which can be used to disconnect *func*).
        r¤   c                 ó   •—  ‰| ¦  «        S r   r5   r$  s    €r    r‘   z(RangeSlider.on_changed.<locals>.<lambda>Ø  r%  r"   r’   r”   s    `r    r&  zRangeSlider.on_changedÉ  r'  r"   )	NNTTTNr¡   rÑ   N)r1   r2   r3   r4   r   r(  r!   r5  rH  rL  rù   rT  rº   r  rP  rQ  rÊ   r&  r›   rœ   s   @r    r*  r*  \  s:  ø€ € € € € ðð ð €TÔ˜E¨	Ð2Ñ2Ô2ð ØØØØØØ ØØðuð uð uð uð uñ 3Ô2ðuðn!ð !ð !ð*	(ð 	(ð 	(ð	(ð 	(ð 	(ðLð Lð Lð5ð 5ð 5ð'3ð '3ð '3ðR#ð #ð #ð)ð )ð )ð)ð )ð )ð=ð =ð =ð:Ið Ið Ið Ið Ið Ið Ir"   r*  c                 ó”   — t          j        | t          j        ¦  «        } | r t	          di | ¤Ž¦   «         nt          j        i ¦  «        S ©Nr5   )r   Únormalize_kwargsÚmtextÚTextr   Ú	itertoolsÚrepeat©Úpropss    r    Ú_expand_text_propsrw  Û  sC   € ÝÔ" 5­%¬*Ñ5Ô5€EØ %Ð?ˆ?�6ˆ?ˆ?�Eˆ?ˆ?ÑÔÐ­9Ô+;¸BÑ+?Ô+?Ð?r"   c                   óø   ‡ — e Zd ZdZddddddœˆ fd„Zd„ Zd„ Zd„ Zd	„ Zd
„ Z	d„ Z
d„ Zd„ Zd„ Zd„ Z ej        dd¬¦  «        ed„ ¦   «         ¦   «         Z ej        dd¬¦  «        ed„ ¦   «         ¦   «         Zˆ xZS )ÚCheckButtonsaE  
    A GUI neutral set of check buttons.

    For the check buttons to remain responsive you must keep a
    reference to this object.

    Connect to the CheckButtons with the `.on_clicked` method.

    Attributes
    ----------
    ax : `~matplotlib.axes.Axes`
        The parent Axes for the widget.

    labels : list of `.Text`

    rectangles : list of `.Rectangle`

    lines : list of (`.Line2D`, `.Line2D`) pairs
        List of lines for the x's in the checkboxes.  These lines exist for
        each box, but have ``set_visible(False)`` when its box is not checked.
    NT)r^   Úlabel_propsÚframe_propsÚcheck_propsc                óª  •‡— t          ¦   «                              ‰¦  «         t          j        t          df|||¬¦  «         ‰                     g ¦  «         ‰                     g ¦  «         ‰                     d¦  «         |€dgt          |¦  «        z  }|o| j	        j
        | _        d| _        t          j        ddt          |¦  «        dz   ¦  «        dd…         }t          |¦  «        }ˆfd„t!          |||¦  «        D ¦   «         | _        t          j        d	„ | j        D ¦   «         ¦  «        dz  }	|	dz  dd
œt'          j        |t*          j        ¦  «        ¥d‰j        dœ¥}|                     d|                     dd¦  «        ¦  «         |                     d|                     dd¦  «        ¦  «          ‰j        dgt          |¦  «        z  |fi |¤Ž| _        d|	dz  dœt'          j        |t*          j        ¦  «        ¥d‰j        | j        dœ¥}|                     d|                     dd¦  «        ¦  «          ‰j        dgt          |¦  «        z  |fi |¤Ž| _        |                      |¦  «         |                      d| j         ¦  «         | j        r|                      d| j!        ¦  «         t'          j"        dg¬¦  «        | _#        dS )aG  
        Add check buttons to `matplotlib.axes.Axes` instance *ax*.

        Parameters
        ----------
        ax : `~matplotlib.axes.Axes`
            The parent Axes for the widget.
        labels : list of str
            The labels of the check buttons.
        actives : list of bool, optional
            The initial check states of the buttons. The list must have the
            same length as *labels*. If not given, all buttons are unchecked.
        useblit : bool, default: True
            Use blitting for faster drawing if supported by the backend.
            See the tutorial :doc:`/tutorials/advanced/blitting` for details.
        label_props : dict, optional
            Dictionary of `.Text` properties to be used for the labels.

            .. versionadded:: 3.7
        frame_props : dict, optional
            Dictionary of scatter `.Collection` properties to be used for the
            check button frame. Defaults (label font size / 2)**2 size, black
            edgecolor, no facecolor, and 1.0 linewidth.

            .. versionadded:: 3.7
        check_props : dict, optional
            Dictionary of scatter `.Collection` properties to be used for the
            check button check. Defaults to (label font size / 2)**2 size,
            black color, and 1.0 linewidth.

            .. versionadded:: 3.7
        N)rz  r{  r|  Fr   r   r  éÿÿÿÿc           	      óJ   •— g | ]\  }}} ‰j         d ||f‰j        dddœ|¤Ž‘Œ S ©rç   rô   ra   )rd   rc   rb   ©r   rm   ©rá   Úyrn   rv  rF   s       €r    r[  z)CheckButtons.__init__.<locals>.<listcomp>+  óf   ø€ ð Að Að Añ  ��5˜%ð ˆBŒG�D˜!˜Uð ¨b¬lØ(.À(ðð àðð ðAð Að Ar"   c                 ó6   — g | ]}|                      ¦   «         ‘ŒS r5   ©Úget_fontsize©rá   r   s     r    r[  z)CheckButtons.__init__.<locals>.<listcomp>0  ó$   € ÐJÐJÐJ°d˜d×/Ò/Ñ1Ô1ÐJÐJÐJr"   )r  Ú	linewidthr  )rß   rd   rÚ   rz   ÚnonerÛ   Úblackç333333Ã?)rŠ  r  Úx©rß   rd   Úanimatedrh   Ú
draw_eventre   rf   )$rk   r!   r   Úcheck_isinstanceÚdictrx   ry   rv   ÚlenrE   ro   rp   Ú_backgroundr¿   Úlinspacerw  ÚzipÚlabelsr1  r   rp  r   ÚPathCollectionrm   Ú
setdefaultÚgetÚpopÚscatterÚ_framesÚ_checksÚ_init_statusrU   Ú_clickedÚ_clearrq   rr   )r   rF   r˜  Úactivesr^   rz  r{  r|  ÚysÚ	text_sizer}   s    `        €r    r!   zCheckButtons.__init__÷  s  øø€ õD 	‰Œ×Ò˜ÑÔÐåÔ�t T˜l¸Ø*5À;ð	Pñ 	Pô 	Pð 	Pð 	�Š�bÑÔÐØ
�Š�bÑÔÐØ
�Š˜ÑÔÐàˆ?Ø�g¥ F¡¤Ñ+ˆGàÐ= D¤KÔ$=ˆŒØˆÔåŒ[˜˜A�s 6™{œ{¨1™}Ñ-Ô-¨a°¨dÔ3ˆå(¨Ñ5Ô5ˆðAð Að Að Aõ $' r¨6°;Ñ#?Ô#?ð	Añ Aô AˆŒõ
 ”HÐJÐJ¸d¼kÐJÑJÔJÑKÔKÈaÑOˆ	ð ˜A‘Øð
ð 
õ Ô$ [µ+Ô2LÑMÔMð
ð Øœð
ð 
ð 
ˆð 	×Ò˜{¨K¯OªO¸GÀVÑ,LÔ,LÑMÔMÐMØ×Ò˜{¨K¯OªO¸GÀWÑ,MÔ,MÑNÔNÐNØ!�r”z 4 &­3¨r©7¬7Ñ"2°BÐFÐF¸+ÐFÐFˆŒàØ˜A‘ð
ð 
õ Ô$ [µ+Ô2LÑMÔMð
ð ØœØœð
ð 
ð 
ˆð 	×Ò˜{¨K¯OªO¸GÀWÑ,MÔ,MÑNÔNÐNØ!�r”z 4 &­3¨r©7¬7Ñ"2°BÐFÐF¸+ÐFÐFˆŒð 	×Ò˜'Ñ"Ô"Ð"à×ÒÐ/°´Ñ?Ô?Ð?ØŒ=ð 	:Ø×Ò˜|¨T¬[Ñ9Ô9Ð9åÔ0¸)¸ÐEÑEÔEˆŒˆˆr"   c                 ó’  — |                       |¦  «        s|                      ¦   «         rdS | j                             | j        j        ¦  «        | _        | j                             | j        ¦  «         t          | d¦  «        rA| j
        D ];\  }}| j                             |¦  «         | j                             |¦  «         Œ:dS dS )ú,Internal event handler to clear the buttons.NÚ_lines)rC   rH   rE   Úcopy_from_bboxrF   rŠ   r•  rˆ   rŸ  rõ   r¨  )r   rB   Úl1Úl2s       r    r¢  zCheckButtons._clearQ  sÌ   € à�;Š;�uÑÔð 	 ×!5Ò!5Ñ!7Ô!7ð 	ØˆFØœ;×5Ò5°d´g´lÑCÔCˆÔØŒ×Ò˜DœLÑ)Ô)Ð)Ý�4˜Ñ"Ô"ð 	(Øœ+ð (ð (‘��BØ”×#Ò# BÑ'Ô'Ð'Ø”×#Ò# BÑ'Ô'Ð'Ð'ð	(ð 	(ð(ð (r"   c                 óZ  — |                       |¦  «        s|j        dk    s|j        | j        k    rd S | j        j                             ¦   «                              |j        |j        f¦  «        }i }t          | d¦  «        �rt          t          | j        | j        ¦  «        ¦  «        D ]Þ\  }\  }}|                     ¦   «         \  }}|                     ¦   «                              |j        |j        ¦  «        sV||d         cxk    r||                     ¦   «         z   k    ren Œ|||d         cxk    r||                     ¦   «         z   k    r:n Œ§t&          j                             ||                     ¦   «         z
  ¦  «        ||<   Œßná| j                             |¦  «        \  }	}
| j                             ¦   «                              | j                             ¦   «         ¦  «        }t          | j        ¦  «        D ]l\  }}||
d         v s2|                     ¦   «                              |j        |j        ¦  «        r+t&          j                             |||         z
  ¦  «        ||<   Œmt5          |¦  «        dk    r-t7          ||j        ¬¦  «        }|                      |¦  «         d S d S )Nr   Ú_rectanglesr   Úind©Úkey)rC   r  r   rF   rm   Úinvertedrd   rŽ  rƒ  rõ   Ú	enumerater—  r­  r˜  Úget_xyÚget_window_extentÚcontainsÚ	get_widthÚ
get_heightr¿   ÚlinalgÚnormÚ
get_centerrž  Úget_offset_transformÚget_offsetsr”  rG  r›  r<   )r   rB   ÚpclickedÚ	distancesÚiÚpÚtÚx0Úy0r  Ú
frame_indsÚcoordsÚclosests                r    r¡  zCheckButtons._clicked\  sƒ  € Ø�;Š;�uÑÔð 	 ¤°Ò!2Ð!2°e´lÀdÄgÒ6MÐ6MØˆFØ”7Ô$×-Ò-Ñ/Ô/×9Ò9¸5¼7ÀEÄGÐ:LÑMÔMˆØˆ	Ý�4˜Ñ'Ô'ñ 	HÝ&¥s¨4Ô+;¸T¼[Ñ'IÔ'IÑJÔJð Mð M‘	�‘6�A�qØŸš™œ‘��BØ×'Ò'Ñ)Ô)×2Ò2°5´7¸E¼GÑDÔDð MØ (¨1¤+ÐCÐCÒCÐC°°a·k²k±m´mÑ1CÒCÐCÐCÐCÐCØ " h¨q¤kÐ HÐ HÒ HÐ H°R¸!¿,º,¹.¼.Ñ5HÒ HÐ HÐ HÐ HÐ HÝ#%¤9§>¢>°(¸Q¿\º\¹^¼^Ñ2KÑ#LÔ#L�I˜a‘LøðMð !œL×1Ò1°%Ñ8Ô8‰MˆAˆzØ”\×6Ò6Ñ8Ô8×BÒBØ”×(Ò(Ñ*Ô*ñô ˆFõ " $¤+Ñ.Ô.ð Hð H‘��1Ø˜ EÔ*Ð*Ð*Ø×.Ò.Ñ0Ô0×9Ò9¸%¼'À5Ä7ÑKÔKð +å#%¤9§>¢>°(¸VÀA¼YÑ2FÑ#GÔ#G�I˜a‘LøÝˆy‰>Œ>˜AÒÐÝ˜)¨¬Ð7Ñ7Ô7ˆGØ�OŠO˜GÑ$Ô$Ð$Ð$Ð$ð Ðr"   c                 óº   — t          j        t          |¬¦  «         t          |¦  «        }t	          | j        |¦  «        D ]\  }}|                     |¦  «         ŒdS ©zÚ
        Set properties of the `.Text` labels.

        .. versionadded:: 3.7

        Parameters
        ----------
        props : dict
            Dictionary of `.Text` properties to be used for the labels.
        ru  N©r   r’  r“  rw  r—  r˜  Úupdate©r   rv  r   Úprops       r    Úset_label_propszCheckButtons.set_label_propsu  óe   € õ 	Ô�d¨%Ð0Ñ0Ô0Ð0Ý" 5Ñ)Ô)ˆÝ˜dœk¨5Ñ1Ô1ð 	ð 	‰JˆD�$Ø�KŠK˜ÑÔÐÐð	ð 	r"   c                 óò   — t          j        t          |¬¦  «         d|v r=t          j        |                     d¦  «        t          | j        ¦  «        ¦  «        |d<   | j         	                    |¦  «         dS )zþ
        Set properties of the check button frames.

        .. versionadded:: 3.7

        Parameters
        ----------
        props : dict
            Dictionary of `.Collection` properties to be used for the check
            button frames.
        ru  r  ÚsizesN)
r   r’  r“  r¿   Úbroadcast_torœ  r”  r˜  rž  rÊ  ©r   rv  s     r    Úset_frame_propszCheckButtons.set_frame_props…  sh   € õ 	Ô�d¨%Ð0Ñ0Ô0Ð0Ø�%ˆ<ˆ<Ýœ_¨U¯YªY°s©^¬^½SÀÄÑ=MÔ=MÑNÔNˆE�'‰NØŒ×Ò˜EÑ"Ô"Ð"Ð"Ð"r"   c                 óD  — t          j        t          |¬¦  «         d|v r=t          j        |                     d¦  «        t          | j        ¦  «        ¦  «        |d<   |                      ¦   «         }| j	         
                    |¦  «         |                      |¦  «         dS )zý
        Set properties of the check button checks.

        .. versionadded:: 3.7

        Parameters
        ----------
        props : dict
            Dictionary of `.Collection` properties to be used for the check
            button check.
        ru  r  rÐ  N)r   r’  r“  r¿   rÑ  rœ  r”  r˜  Ú
get_statusrŸ  rÊ  r   )r   rv  r£  s      r    Úset_check_propszCheckButtons.set_check_props–  s‹   € õ 	Ô�d¨%Ð0Ñ0Ô0Ð0Ø�%ˆ<ˆ<Ýœ_¨U¯YªY°s©^¬^½SÀÄÑ=MÔ=MÑNÔNˆE�'‰NØ—/’/Ñ#Ô#ˆØŒ×Ò˜EÑ"Ô"Ð"à×Ò˜'Ñ"Ô"Ð"Ð"Ð"r"   c                 ó~  — |t          t          | j        ¦  «        ¦  «        vrt          d|› �¦  «        ‚t	          j        d¦  «        }| j                             ¦   «         }t	          j        ||         |¦  «        r| j	        |         n|||<   | j         
                    |¦  «         t          | d¦  «        r`| j        |         \  }}|                     |                     ¦   «          ¦  «         |                     |                     ¦   «          ¦  «         | j        rÛ| j        r»| j        �| j                             | j        ¦  «         | j                             | j        ¦  «         t          | d¦  «        rA| j        D ]9\  }}| j                             |¦  «         | j                             |¦  «         Œ:| j                             | j        j        ¦  «         n| j                             ¦   «          | j        r:| j                             d| j        |                              ¦   «         ¦  «         dS dS )aM  
        Toggle (activate or deactivate) a check button by index.

        Callbacks will be triggered if :attr:`eventson` is True.

        Parameters
        ----------
        index : int
            Index of the check button to toggle.

        Raises
        ------
        ValueError
            If *index* is invalid.
        zInvalid CheckButton index: r‹  r¨  Nre   )Úranger”  r˜  r&   r   Úto_rgbarŸ  r‡   r†   Ú_active_check_colorsrw   rõ   r¨  Úset_visibleÚget_visiblerI   rp   r•  rE   Úrestore_regionrF   rˆ   r‰   rŠ   r‹   rJ   rr   r„   Úget_text)r   ÚindexÚ	invisibleÚ
facecolorsrª  r«  s         r    r<   zCheckButtons.set_activeª  s%  € ð  ��c $¤+Ñ.Ô.Ñ/Ô/Ð/Ð/ÝÐB¸5ÐBÐBÑCÔCÐCå”N 6Ñ*Ô*ˆ	à”\×/Ò/Ñ1Ô1ˆ
õ Ô  ¨EÔ!2°IÑ>Ô>ðˆDÔ% eÔ,Ð,àð 	�5Ñð
 	Œ×"Ò" :Ñ.Ô.Ð.å�4˜Ñ"Ô"ð 	1Ø”[ Ô'‰FˆB�Ø�NŠN˜rŸ~š~Ñ/Ô/Ð/Ñ0Ô0Ð0Ø�NŠN˜rŸ~š~Ñ/Ô/Ð/Ñ0Ô0Ð0àŒ;ð 	#ØŒ}ð 
#ØÔ#Ð/Ø”K×.Ò.¨tÔ/?Ñ@Ô@Ð@Ø”×#Ò# D¤LÑ1Ô1Ð1Ý˜4 Ñ*Ô*ð 0Ø"&¤+ð 0ð 0™˜˜BØœ×+Ò+¨BÑ/Ô/Ð/Øœ×+Ò+¨BÑ/Ô/Ð/Ð/Ø”× Ò  ¤¤Ñ.Ô.Ð.Ð.à”× Ò Ñ"Ô"Ð"àŒ=ð 	NØŒO×#Ò# I¨t¬{¸5Ô/A×/JÒ/JÑ/LÔ/LÑMÔMÐMÐMÐMð	Nð 	Nr"   c                 ó<  — | j                              ¦   «         | _        t          | j        ¦  «        dk    r.t	          j        | j        t          |¦  «        d¬¦  «        | _        | j                              d„ t          | j        |¦  «        D ¦   «         ¦  «         dS )a  
        Initialize properties to match active status.

        The user may have passed custom colours in *check_props* to the
        constructor, or to `.set_check_props`, so we need to modify the
        visibility after getting whatever the user set.
        r   r   ©r¼   c                 ó    — g | ]\  }}|r|nd ‘ŒS ©r‹  r5   )rá   Úecr;   s      r    r[  z-CheckButtons._init_status.<locals>.<listcomp>é  s;   € ð Hð Hð HÙ��Vð Ð%ˆRˆR˜vð Hð Hð Hr"   N)rŸ  r‡   rÚ  r”  r¿   rt  rw   r—  )r   r£  s     r    r   zCheckButtons._init_statusÜ  s³   € ð %)¤L×$>Ò$>Ñ$@Ô$@ˆÔ!ÝˆtÔ(Ñ)Ô)¨QÒ.Ð.Ý(*¬	°$Ô2KÝ25°g±,´,ÀQð)Hñ )Hô )HˆDÔ%àŒ×"Ò"ðHð HÝ" 4Ô#<¸gÑFÔFðHñ Hô Hñ	Iô 	Ið 	Ið 	Ið 	Ir"   c                 óH   — d„ | j                              ¦   «         D ¦   «         S )zW
        Return a list of the status (True/False) of all of the check buttons.
        c                 ó^   — g | ]*}t          j        |t          j        d ¦  «        ¦  «         ‘Œ+S rå  )r   r†   rÙ  )rá   rz   s     r    r[  z+CheckButtons.get_status.<locals>.<listcomp>ð  sB   € ð <ð <ð <Øõ Ô% e­V¬^¸FÑ-CÔ-CÑDÔDÐDð <ð <ð <r"   )rŸ  Úget_facecolorsr   s    r    rÕ  zCheckButtons.get_statusì  s1   € ð<ð <Ø!œ\×8Ò8Ñ:Ô:ð<ñ <ô <ð 	<r"   c                 ó@   ‡— | j                              dˆfd„¦  «        S )rŽ   re   c                 ó   •—  ‰| ¦  «        S r   r5   ©r   r�   s    €r    r‘   z)CheckButtons.on_clicked.<locals>.<lambda>ù  s   ø€ ¸t¸tÀD¹z¼z€ r"   r’   r”   s    `r    r•   zCheckButtons.on_clickedó  s'   ø€ ð Œ×&Ò& yÐ2IÐ2IÐ2IÐ2IÑJÔJÐJr"   c                 ó:   — | j                              |¦  «         dS ©z-Remove the observer with connection id *cid*.Nr—   r™   s     r    r˜   zCheckButtons.disconnectû  rš   r"   rÎ   ú(Any custom property styling may be lost.©Úaddendumc                 ó(  ‡ ‡‡‡— t          ‰ d¦  «        s¶t          j        ddt          ‰ j        ¦  «        dz   ¦  «        dd…         Šdt          ‰ j        ¦  «        dz   z  }|dz  |dz  cŠŠˆˆ ˆˆfd„t          ‰¦  «        D ¦   «         x}‰ _        ‰ j                             d¦  «         |D ]}‰ j	         
                    |¦  «         Œt          ‰ d	¦  «        s2t          j        ¦   «         5  ‰ j        }d d d ¦  «         n# 1 swxY w Y   ‰ j        S )
Nr­  r   r   r  r~  ç      ð?c           
      óp   •— g | ]2\  }}t          d ‰|         ‰dz  z
  f‰‰dd‰j        j        ¬¦  «        ‘Œ3S )çš™™™™™©?r  rŒ  r‹  )r  ÚwidthÚheightrÛ   rÚ   rd   )r   rF   rm   )rá   r¿  rƒ  rZ  r   Úwr¤  s      €€€€r    r[  z+CheckButtons.rectangles.<locals>.<listcomp>  sc   ø€ ð -ð -ð -ñ �A�qõ ˜d B q¤E¨A°©E¡MÐ2¸!ÀAØ$+Ø$*Ø$(¤GÔ$5ðñ ô ð-ð -ð -r"   Fr¨  )rõ   r¿   r–  r”  r˜  r²  r­  rž  rÛ  rF   rü   r   Ú'suppress_matplotlib_deprecation_warningÚlines)r   ÚdyÚ
rectanglesÚ	rectangler  rZ  rø  r¤  s   `    @@@r    rü  zCheckButtons.rectanglesÿ  s€  øøøø€ õ �t˜]Ñ+Ô+ð 	-Ý”˜Q ¥3 t¤{Ñ#3Ô#3°AÑ#5Ñ6Ô6°q¸°tÔ<ˆBØ•s˜4œ;Ñ'Ô'¨!Ñ+Ñ,ˆBØ˜‘6˜2 ™6ˆDˆAˆqð-ð -ð -ð -ð -ð -ð -õ & b™MœMð-ñ -ô -ð ˆJ˜Ô)ð ŒL×$Ò$ UÑ+Ô+Ð+Ø'ð -ð -�	Ø”×!Ò! )Ñ,Ô,Ð,Ð,Ý�t˜XÑ&Ô&ð 	ÝÔ=Ñ?Ô?ð ð Ø”J�ðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð àÔÐs   Ã.DÄDÄ	Dc                 ó¦  — t          | d¦  «        �sxt          j        ddt          | j        ¦  «        dz   ¦  «        dd…         }| j                             d¦  «         dt          | j        ¦  «        dz   z  }|dz  |dz  }}g | _        |                      ¦   «         }dd	| j	        j
        d
| j        dœ}t          |¦  «        D ]Å\  }}d||dz  z
  }}	t          |	|	|z   g||z   |gfi |¤Ž}
t          |	|	|z   g|||z   gfi |¤Ž}|
                     ||         ¦  «         |                     ||         ¦  «         | j                             |
|f¦  «         | j	                             |
¦  «         | j	                             |¦  «         ŒÆt          | d¦  «        s2t!          j        ¦   «         5  | j        }d d d ¦  «         n# 1 swxY w Y   | j        S )Nr¨  r   r   r  r~  Fró  râ   g      ô?Úbutt)rz   rŠ  rd   Úsolid_capstyler�  rõ  r­  )rõ   r¿   r–  r”  r˜  rŸ  rÛ  r¨  rÕ  rF   rm   rp   r²  r   rR   Úadd_liner   rù  rü  )r   r¤  rû  rø  rZ  Úcurrent_statusÚ
lineparamsr¿  rƒ  rŽ  rª  r«  r  s                r    rú  zCheckButtons.lines  s.  € õ �t˜XÑ&Ô&ñ 	%Ý”˜Q ¥3 t¤{Ñ#3Ô#3°AÑ#5Ñ6Ô6°q¸°tÔ<ˆBØŒL×$Ò$ UÑ+Ô+Ð+Ø•s˜4œ;Ñ'Ô'¨!Ñ+Ñ,ˆBØ˜‘6˜2 ™6ˆqˆAØˆDŒKØ!Ÿ_š_Ñ.Ô.ˆNØ#&°TØ'+¤wÔ'8Ø,2Ø&*¤mð5ð 5ˆJõ " "™œð 	%ð 	%‘��1Ø˜Q  Q¡™Y�1�Ý˜Q  A¡˜J¨¨Q©°¨
ÐAÐA°jÐAÐA�Ý˜Q  A¡˜J¨¨A°©E¨
ÐAÐA°jÐAÐA�à—’˜~¨aÔ0Ñ1Ô1Ð1Ø—’˜~¨aÔ0Ñ1Ô1Ð1Ø”×"Ò" B¨ 8Ñ,Ô,Ð,Ø”× Ò  Ñ$Ô$Ð$Ø”× Ò  Ñ$Ô$Ð$Ð$Ý�t˜]Ñ+Ô+ð 	$ÝÔ=Ñ?Ô?ð $ð $Ø”O�ð$ð $ð $ñ $ô $ð $ð $ð $ð $ð $ð $øøøð $ð $ð $ð $àŒ{Ðs   Æ-GÇGÇGr   )r1   r2   r3   r4   r!   r¢  r¡  rÍ  rÓ  rÖ  r<   r   rÕ  r•   r˜   r   Ú
deprecatedrK   rü  rú  r›   rœ   s   @r    ry  ry  à  s•  ø€ € € € € ðð ð,XF¸DØ!¨tÀðXFð XFð XFð XFð XFð XFð XFðt	(ð 	(ð 	(ð%ð %ð %ð2ð ð ð #ð #ð #ð"#ð #ð #ð(0Nð 0Nð 0NðdIð Ið Ið <ð <ð <ðKð Kð Kð(ð (ð (ð €T„_�UØHðJñ Jô Jàð ð  ñ „XñJô Jð ð* €T„_�UØHðJñ Jô Jàðð ñ „XñJô Jðð ð ð ð r"   ry  c                   óè   ‡ — e Zd ZdZ ej        dd¬¦  «        	 	 	 dˆ fd
„	¦   «         Zed„ ¦   «         Zd„ Z	d„ Z
d„ Zd„ Z ej        dd¦  «        dd„¦   «         Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zˆ xZS )ÚTextBoxa*  
    A GUI neutral text input box.

    For the text box to remain responsive you must keep a reference to it.

    Call `.on_text_change` to be updated whenever the text changes.

    Call `.on_submit` to be updated whenever the user hits enter or
    leaves the text entry field.

    Attributes
    ----------
    ax : `~matplotlib.axes.Axes`
        The parent Axes for the widget.
    label : `.Text`

    color : color
        The color of the text box when not hovering.
    hovercolor : color
        The color of the text box when hovering.
    rÎ   rz   rÏ   Ú ú.95Ú1ç{®Gáz„?rô   c           
      ól  •— t          ¦   «                              |¦  «         t          j        ddddœ|¬¦  «        | _        |                     | d||j        dd¬¦  «        | _        | j                             | j        d|| j        j        d|d	¬
¦  «        | _	        t          j        ddg¬¦  «        | _        |                     ddd	|g g ¬¦  «         d| _        |                     dddd	ddt           j                             ¦   «         ¬¦  «        | _        |                      d| j        ¦  «         |                      d| j        ¦  «         |                      d| j        ¦  «         |                      d| j        ¦  «         |                      d| j        ¦  «         || _        || _        d	| _        dS )aq  
        Parameters
        ----------
        ax : `~matplotlib.axes.Axes`
            The `~.axes.Axes` instance the button will be placed into.
        label : str
            Label for this text box.
        initial : str
            Initial value in the text box.
        color : color
            The color of the box.
        hovercolor : color
            The color of the box when the mouse is over it.
        label_pad : float
            The distance between the label and the right side of the textbox.
        textalignment : {'left', 'center', 'right'}
            The horizontal location of the text.
        rõ  r`   gffffffî?)rô   ra   ró   )Útextalignmentra   ró   rð   F)rd   rb   rc   Ú
parse_mathÚchangeÚsubmitrf   ©r   r   )ÚxlimÚylimÚnavigaterÚ   ÚxticksÚyticksr   râ   r   )Úvisiblerz   rê   rd   rh   ri   rj   Úkey_press_eventÚresize_eventN)rk   r!   r   Úcheck_getitemÚ_text_positionr   rm   rn   rF   Ú	text_dispr   rq   rr   ÚsetÚcursor_indexÚvlinesÚmplr   ÚIdentityTransformÚcursorrU   rs   rt   ru   Ú	_keypressÚ_resizerz   r{   Úcapturekeystrokes)	r   rF   rn   Úinitialrz   r{   Ú	label_padr  r}   s	           €r    r!   zTextBox.__init__M  sÑ  ø€ õ, 	‰Œ×Ò˜ÑÔÐå"Ô0Ø S°4Ð8Ð8Ø'ð)ñ )ô )ˆÔð —W’WØˆJ˜˜U¨b¬lØ&¸Gð ñ Eô EˆŒ
ð
 œŸšØÔ  g¸¼Ô9JØ&¸MØð &ñ ô ˆŒõ
  Ô0¸(ÀHÐ9MÐNÑNÔNˆŒà
�ŠØ˜fØ eØ˜bð 	ñ 	"ô 	"ð 	"ð
 ˆÔà—i’i  1 a°¸cÀaÝ*-¬.×*JÒ*JÑ*LÔ*Lð  ñ Nô NˆŒð 	×ÒÐ/°´Ñ=Ô=Ð=Ø×ÒÐ1°4´=ÑAÔAÐAØ×ÒÐ0°$´,Ñ?Ô?Ð?Ø×ÒÐ,¨d¬nÑ=Ô=Ð=Ø×Ò˜>¨4¬<Ñ8Ô8Ð8àˆŒ
Ø$ˆŒà!&ˆÔÐÐr"   c                 ó4   — | j                              ¦   «         S r   )r  rÞ  r   s    r    r   zTextBox.textŠ  s   € àŒ~×&Ò&Ñ(Ô(Ð(r"   c                 ó$  — | j         j                             ¦   «         €#| j         j        j                             ¦   «          | j                             ¦   «         }|d | j        …         }| j                             ¦   «         }| j         	                    |pd¦  «         | j                             ¦   «         }|j
        |j        k    r1|xj
        |j        dz  z  c_
        |xj        |j        dz  z  c_        n#|s|j        |_        n|j        |j        z   |_        | j                             |j        |j
        f|j        |j        fggd¬¦  «         | j         	                    |¦  «         | j         j        j                             ¦   «          d S )Nú,r  T)Úsegmentsr  )rF   rG   Ú_get_rendererrE   r‹   r  rÞ  r  r´  r   rÃ  Úy1r÷  rÂ  Úx1rö  r!  r  )r   r   Ú	widthtextÚbb_textÚbb_widthtexts        r    Ú_rendercursorzTextBox._rendercursorŽ  ss  € ð Œ7Œ>×'Ò'Ñ)Ô)Ð1ØŒGŒNÔ!×&Ò&Ñ(Ô(Ð(àŒ~×&Ò&Ñ(Ô(ˆØÐ+˜$Ô+Ð+Ô,ˆ	à”.×2Ò2Ñ4Ô4ˆØŒ×Ò 	Ð 0¨SÑ1Ô1Ð1Ø”~×7Ò7Ñ9Ô9ˆàŒ:˜œÒ#Ð#ØˆJŒJ˜,Ô-°Ñ1Ñ1ˆJŒJØˆJŒJ˜,Ô-°Ñ1Ñ1ˆJŒJˆJØð 	9Ø œˆGŒJˆJà œ lÔ&8Ñ8ˆGŒJàŒ�ŠØœ
 G¤JÐ/°'´*¸g¼jÐ1IÐJÐKØð 	ñ 	ô 	ð 	ð 	Œ×Ò Ñ%Ô%Ð%àŒŒÔ×"Ò"Ñ$Ô$Ð$Ð$Ð$r"   c                 ó    — |                       |¦  «        rd S |j        j        | j        k    rd S |j                             | j        ¦  «         d S r   )rC   rE   r€   rF   rƒ   rA   s     r    rt   zTextBox._release°  sP   € Ø�;Š;�uÑÔð 	ØˆFØŒ<Ô%¨¬Ò0Ð0ØˆFØŒ×"Ò" 4¤7Ñ+Ô+Ð+Ð+Ð+r"   c                 óò  — |                       |¦  «        rd S | j        �rÓ|j        }| j        }t	          |¦  «        dk    r4|d | j        …         |z   || j        d …         z   }| xj        dz  c_        �n|dk    r)| j        t	          |¦  «        k    r| xj        dz  c_        nÔ|dk    r| j        dk    r| xj        dz  c_        n²|dk    rd| _        n¤|dk    rt	          |¦  «        | _        n‰|dk    r>| j        dk    r2|d | j        dz
  …         || j        d …         z   }| xj        dz  c_        nE|dk    r?| j        t	          | j        ¦  «        k    r"|d | j        …         || j        dz   d …         z   }| j                             |¦  «         |                      ¦   «          | j	        rH| j
                             d	| j        ¦  «         |d
v r&| j
                             d| j        ¦  «         d S d S d S d S )Nr   ró   rô   r   ÚhomeÚendÚ	backspaceÚdeleter  )ÚenterÚreturnr  )rC   r$  r°  r   r”  r  r  r   r1  rJ   rr   r„   )r   rB   r°  r   s       r    r"  zTextBox._keypress·  sU  € Ø�;Š;�uÑÔð 	ØˆFØÔ!ñ 	AØ”)ˆCØ”9ˆDÝ�3‰xŒx˜1Š}ˆ}ØÐ/˜dÔ/Ð/Ô0°3Ñ6Ø˜TÔ.Ð/Ð/Ô0ñ1�àÐ!Ô! QÑ&Ð!Ô!Ñ!Ø˜’�ØÔ$­¨D©	¬	Ò1Ð1ØÐ%Ô%¨Ñ*Ð%Ô%øØ˜’�ØÔ$¨Ò)Ð)ØÐ%Ô%¨Ñ*Ð%Ô%øØ˜’�Ø$%�Ô!Ð!Ø˜’�Ý$'¨¡I¤I�Ô!Ð!Ø˜Ò#Ð#ØÔ$¨Ò)Ð)Ø Ð!7 $Ô"3°aÑ"7Ð!7Ô8Ø  Ô!2Ð!3Ð!3Ô4ñ5�DàÐ%Ô%¨Ñ*Ð%Ô%øØ˜’�ØÔ$­¨D¬I©¬Ò6Ð6Ø Ð!3 $Ô"3Ð!3Ô4Ø  Ô!2°QÑ!6Ð!7Ð!7Ô8ñ9�DàŒN×#Ò# DÑ)Ô)Ð)Ø×ÒÑ Ô Ð ØŒ}ð AØ”×'Ò'¨°$´)Ñ<Ô<Ð<ØÐ-Ð-Ð-Ø”O×+Ò+¨H°d´iÑ@Ô@Ð@Ð@Ð@ð?	Að 	Að8Að Aà-Ð-r"   c                 ó,  — t          |¦  «        }| j        |k    rd S | j                             |¦  «         |                      ¦   «          | j        rB| j                             d| j        ¦  «         | j                             d| j        ¦  «         d S d S )Nr  r  )Ústrr   r  r   r1  rJ   rr   r„   )r   rÄ   Únewvals      r    rÊ   zTextBox.set_valÛ  s•   € Ý�S‘”ˆØŒ9˜ÒÐØˆFØŒ×Ò Ñ'Ô'Ð'Ø×ÒÑÔÐØŒ=ð 	9ØŒO×#Ò# H¨d¬iÑ8Ô8Ð8ØŒO×#Ò# H¨d¬iÑ8Ô8Ð8Ð8Ð8ð	9ð 	9r"   rŽ  Nc                 óÒ  — d| _         t          ¦   «         }|j        | _        t	          | j        j        j        j        dd ¦  «        }|�7| 	                    | ¦  «         | 
                    |j	        j        | ¦  «         d S t          j        ¦   «         5  |                     t          j        d„ t          j        D ¦   «         ¦  «        ¦  «         d d d ¦  «         d S # 1 swxY w Y   d S )NTÚtoolmanagerc                 ó>   — i | ]}|                      d ¦  «        ¯|g “ŒS )zkeymap.)Ú
startswith)rá   râ   s     r    rä   z(TextBox.begin_typing.<locals>.<dictcomp>ù  s+   € ÐLÐLÐL˜q°A·L²LÀÑ4KÔ4KÐL�Q˜ÐLÐLÐLr"   )r$  r   ÚcloseÚ_on_stop_typingÚgetattrrF   rG   rE   ÚmanagerÚkeypresslockrS   r+   r   rù  Úenter_contextr  Ú
rc_contextÚrcParams)r   rŽ  Ústackr>  s       r    Úbegin_typingzTextBox.begin_typingå  sD  € à!%ˆÔõ ‘”ˆØ$œ{ˆÔÝØŒGŒNÔ!Ô)¨=¸$ñ@ô @ˆàÐ"ð ×$Ò$ TÑ*Ô*Ð*Ø�NŠN˜;Ô3Ô;¸TÑBÔBÐBÐBÐBõ Ô=Ñ?Ô?ð Oð OØ×#Ò#¥C¤NØLÐL¥C¤LÐLÑLÔLñ%Nô %Nñ Oô Oð OðOð Oð Oñ Oô Oð Oð Oð Oð Oð Oð Oð Oøøøð Oð Oð Oð Oð Oð Os   Â<CÃC Ã#C c                 ó6  — | j         r|                      ¦   «          d | _        d}nd}d| _         | j                             d¦  «         | j        j        j                             ¦   «          |r)| j        r$| j	         
                    d| j        ¦  «         d S d S d S )NTFr  )r$  rB  r!  rÛ  rF   rG   rE   r‹   rJ   rr   r„   r   )r   Únotifysubmits     r    Ústop_typingzTextBox.stop_typingû  s±   € ØÔ!ð 	!Ø× Ò Ñ"Ô"Ð"Ø#'ˆDÔ ØˆLˆLà ˆLØ!&ˆÔØŒ×Ò Ñ&Ô&Ð&ØŒŒÔ×"Ò"Ñ$Ô$Ð$Øð 	9˜DœMð 	9ð ŒO×#Ò# H¨d¬iÑ8Ô8Ð8Ð8Ð8ð	9ð 	9ð 	9ð 	9r"   c                 ó   — |                       |¦  «        rd S |j        | j        k    r|                      ¦   «          d S | j        sd S |j        j        | j        k    r|j                             | j        ¦  «         | j        s|  	                    ¦   «          | j
                             |j        ¦  «        | _        |                      ¦   «          d S r   )rC   r   rF   rM  rJ   rE   r€   r�   r$  rJ  r  Ú_char_index_atrŽ  r  r1  rA   s     r    rs   zTextBox._click
  sÉ   € Ø�;Š;�uÑÔð 	ØˆFØŒ<˜4œ7Ò"Ð"Ø×ÒÑÔÐØˆFØŒ}ð 	ØˆFØŒ<Ô%¨¬Ò0Ð0ØŒL×#Ò# D¤GÑ,Ô,Ð,ØÔ%ð 	 Ø×ÒÑÔÐØ œN×9Ò9¸%¼'ÑBÔBˆÔØ×ÒÑÔÐÐÐr"   c                 ó.   — |                       ¦   «          d S r   )rM  rA   s     r    r#  zTextBox._resize  s   € Ø×ÒÑÔÐÐÐr"   c                 óX  — |                       |¦  «        rd S |j        | j        k    r| j        n| j        }t          j        || j                             ¦   «         ¦  «        sF| j                             |¦  «         | j	        r'| j        j
        j                             ¦   «          d S d S d S r   )rC   r   rF   r{   rz   r   r†   r‡   rw   rI   rG   rE   r‹   rŒ   s      r    ru   zTextBox._motion  s¬   € Ø�;Š;�uÑÔð 	ØˆFØ$œ|¨t¬wÒ6Ð6ˆDŒOˆO¸D¼JˆÝÔ   D¤G×$9Ò$9Ñ$;Ô$;Ñ<Ô<ð 	-ØŒG×!Ò! !Ñ$Ô$Ð$ØŒ{ð -Ø””Ô%×*Ò*Ñ,Ô,Ð,Ð,Ð,ð	-ð 	-ð-ð -r"   c                 ó@   ‡— | j                              dˆfd„¦  «        S )z‹
        When the text changes, call this *func* with event.

        A connection id is returned which can be used to disconnect.
        r  c                 ó   •—  ‰| ¦  «        S r   r5   rì  s    €r    r‘   z(TextBox.on_text_change.<locals>.<lambda>+  ó   ø€ ¸d¸dÀ4¹j¼j€ r"   r’   r”   s    `r    Úon_text_changezTextBox.on_text_change%  s'   ø€ ð Œ×&Ò& xÐ1HÐ1HÐ1HÐ1HÑIÔIÐIr"   c                 ó@   ‡— | j                              dˆfd„¦  «        S )z³
        When the user hits enter or leaves the submission box, call this
        *func* with event.

        A connection id is returned which can be used to disconnect.
        r  c                 ó   •—  ‰| ¦  «        S r   r5   rì  s    €r    r‘   z#TextBox.on_submit.<locals>.<lambda>4  rT  r"   r’   r”   s    `r    Ú	on_submitzTextBox.on_submit-  s'   ø€ ð Œ×&Ò& xÐ1HÐ1HÐ1HÐ1HÑIÔIÐIr"   c                 ó:   — | j                              |¦  «         dS rî  r—   r™   s     r    r˜   zTextBox.disconnect6  rš   r"   )r  r  r	  r
  rô   r   )r1   r2   r3   r4   r   r(  r!   rK   r   r1  rt   r"  rÊ   Údelete_parameterrJ  rM  rs   r#  ru   rU  rX  r˜   r›   rœ   s   @r    r  r  6  so  ø€ € € € € ðð ð, €TÔ˜E¨Ð0Ñ0Ô0Ø*,Ø8;Ø%ð:'ð :'ð :'ð :'ð :'ñ 1Ô0ð:'ðx ð)ð )ñ „Xð)ð %ð  %ð  %ðD,ð ,ð ,ð"Að "Að "AðH9ð 9ð 9ð €TÔ˜5 #Ñ&Ô&ðOð Oð Oñ 'Ô&ðOð*9ð 9ð 9ðð ð ðð ð ð-ð -ð -ðJð Jð JðJð Jð Jð(ð (ð (ð (ð (ð (ð (r"   r  c                   óÔ   ‡ — e Zd ZdZdddddœˆ fd„Zd„ Zd„ Zd	„ Zd
„ Ze	d„ ¦   «         Z
e
j        d„ ¦   «         Z
d„ Zd„ Zd„ Z ej        dd¬¦  «        e	d„ ¦   «         ¦   «         Zˆ xZS )ÚRadioButtonsa/  
    A GUI neutral radio button.

    For the buttons to remain responsive you must keep a reference to this
    object.

    Connect to the RadioButtons with the `.on_clicked` method.

    Attributes
    ----------
    ax : `~matplotlib.axes.Axes`
        The parent Axes for the widget.
    activecolor : color
        The color of the selected button.
    labels : list of `.Text`
        The button labels.
    circles : list of `~.patches.Circle`
        The buttons.
    value_selected : str
        The label text of the currently selected button.
    r   NT)r^   rz  Úradio_propsc                óò  •‡‡— t          ¦   «                              ‰¦  «         t          j        t          df||¬¦  «         t          j        |t          j        ¦  «        }|�d|v rt          j	        d¦  «         nd}|| _
        |‰         | _        ‰                     g ¦  «         ‰                     g ¦  «         ‰                     d¦  «         t          j        ddt#          |¦  «        d	z   ¦  «        dd
…         }|o| j        j        | _        d| _        t-          |¦  «        }ˆfd„t/          |||¦  «        D ¦   «         | _        t          j        d„ | j        D ¦   «         ¦  «        d	z  }	d|	d	z  i|¥d‰j        | j        dœ¥}|                     d|                     dd¦  «        ¦  «         |                     d|                     d|¦  «        ¦  «          ‰j        dgt#          |¦  «        z  |fi |¤Ž| _        | j                              ¦   «         | _!        t#          | j!        ¦  «        dk    r.t          j"        | j!        t#          |¦  «        d¬¦  «        | _!        | j         #                    ˆfd„tI          | j!        ¦  «        D ¦   «         ¦  «         |  %                    d| j&        ¦  «         | j        r|  %                    d| j'        ¦  «         t          j(        dg¬¦  «        | _)        dS )a!  
        Add radio buttons to an `~.axes.Axes`.

        Parameters
        ----------
        ax : `~matplotlib.axes.Axes`
            The Axes to add the buttons to.
        labels : list of str
            The button labels.
        active : int
            The index of the initially selected button.
        activecolor : color
            The color of the selected button. The default is ``'blue'`` if not
            specified here or in *radio_props*.
        useblit : bool, default: True
            Use blitting for faster drawing if supported by the backend.
            See the tutorial :doc:`/tutorials/advanced/blitting` for details.
        label_props : dict or list of dict, optional
            Dictionary of `.Text` properties to be used for the labels.

            .. versionadded:: 3.7
        radio_props : dict, optional
            Dictionary of scatter `.Collection` properties to be used for the
            radio buttons. Defaults to (label font size / 2)**2 size, black
            edgecolor, and *activecolor* facecolor (when active).

            .. note::
                If a facecolor is supplied in *radio_props*, it will override
                *activecolor*. This may be used to provide an active color per
                button.

            .. versionadded:: 3.7
        N)rz  r]  rÚ   zŠBoth the *activecolor* parameter and the *facecolor* key in the *radio_props* parameter has been specified. *activecolor* will be ignored.ÚblueFr   r   r  r~  c           	      óJ   •— g | ]\  }}} ‰j         d ||f‰j        dddœ|¤Ž‘Œ S r€  r�  r‚  s       €r    r[  z)RadioButtons.__init__.<locals>.<listcomp>’  r„  r"   c                 ó6   — g | ]}|                      ¦   «         ‘ŒS r5   r†  rˆ  s     r    r[  z)RadioButtons.__init__.<locals>.<listcomp>—  r‰  r"   r  r(   r�  rÛ   rz   rŒ  r�  rã  c                 ó*   •— g | ]\  }}|‰k    r|nd ‘ŒS rå  r5   )rá   r¿  Úactivecolorr;   s      €r    r[  z)RadioButtons.__init__.<locals>.<listcomp>¬  s?   ø€ ð Cð Cð CÙ��Kð  šK˜Kˆ[ˆ[¨Vð Cð Cð Cr"   rh   r‘  re   rf   )*rk   r!   r   r’  r“  r   rp  r   r™  Úwarn_externalÚ_activecolorÚvalue_selectedrx   ry   rv   r¿   r–  r”  rE   ro   rp   r•  rw  r—  r˜  r1  rm   rš  r›  rœ  r�  Ú_buttonsr‡   Ú_active_colorsrt  rw   r²  rU   r¡  r¢  rq   rr   )r   rF   r˜  r;   rc  r^   rz  r]  r¤  r¥  r}   s    ` `      €r    r!   zRadioButtons.__init__R  sK  øøø€ õF 	‰Œ×Ò˜ÑÔÐåÔ�t T˜l¸Ø*5ð	7ñ 	7ô 	7ð 	7õ Ô,¨[Ý-8Ô-GñIô IˆàÐ"Ø˜kÐ)Ð)ÝÔ"ð5ñ6ô 6ð 6øð
 !ˆKà'ˆÔØ$ VœnˆÔà
�Š�bÑÔÐØ
�Š�bÑÔÐØ
�Š˜ÑÔÐåŒ[˜˜A�s 6™{œ{¨Q™Ñ/Ô/°°"°Ô5ˆàÐ= D¤KÔ$=ˆŒØˆÔå(¨Ñ5Ô5ˆðAð Að Að Aõ $' r¨6°;Ñ#?Ô#?ð	Añ Aô AˆŒõ
 ”HÐJÐJ¸d¼kÐJÑJÔJÑKÔKÈaÑOˆ	ð �˜A‘ð
àð
ð ØœØœð
ð 
ð 
ˆð 	×Ò˜{¨K¯OªO¸GÀWÑ,MÔ,MÑNÔNÐNØ×Ò˜{Ø*Ÿš¨w¸ÑDÔDñ	Fô 	Fð 	Fà"˜œ
 C 5­3¨r©7¬7¡?°BÐFÐF¸+ÐFÐFˆŒð #œm×9Ò9Ñ;Ô;ˆÔÝˆtÔ"Ñ#Ô# qÒ(Ð(Ý"$¤)¨DÔ,?ÅÀVÁÄØ12ð#4ñ #4ô #4ˆDÔàŒ×#Ò#ðCð Cð Cð CÝ#,¨TÔ-@Ñ#AÔ#AðCñ Cô Cñ	Dô 	Dð 	Dð 	×ÒÐ/°´Ñ?Ô?Ð?ØŒ=ð 	:Ø×Ò˜|¨T¬[Ñ9Ô9Ð9åÔ0¸)¸ÐEÑEÔEˆŒˆˆr"   c                 óX  — |                       |¦  «        s|                      ¦   «         rdS | j                             | j        j        ¦  «        | _        | j                             | j        ¦  «         t          | d¦  «        r$| j
        D ]}| j                             |¦  «         ŒdS dS )r§  NÚ_circles)rC   rH   rE   r©  rF   rŠ   r•  rˆ   rg  rõ   rj  )r   rB   Úcircles      r    r¢  zRadioButtons._clearµ  s²   € à�;Š;�uÑÔð 	 ×!5Ò!5Ñ!7Ô!7ð 	ØˆFØœ;×5Ò5°d´g´lÑCÔCˆÔØŒ×Ò˜DœMÑ*Ô*Ð*Ý�4˜Ñ$Ô$ð 	,Øœ-ð ,ð ,�Ø”×#Ò# FÑ+Ô+Ð+Ð+ð	,ð 	,ð,ð ,r"   c                 óÄ  — |                       |¦  «        s|j        dk    s|j        | j        k    rd S | j        j                             ¦   «                              |j        |j        f¦  «        }| j	         
                    |¦  «        \  }}| j	                             ¦   «                              | j	                             ¦   «         ¦  «        }i }t          | d¦  «        r½t          t          | j        | j        ¦  «        ¦  «        D ]”\  }\  }}	|	                     ¦   «          
                    |j        |j        ¦  «        s0t&          j                             ||j        z
  ¦  «        |j        k     r*t&          j                             ||j        z
  ¦  «        ||<   Œ•n�t          | j        ¦  «        D ]l\  }}	||d         v s2|	                     ¦   «          
                    |j        |j        ¦  «        r+t&          j                             |||         z
  ¦  «        ||<   Œmt1          |¦  «        dk    r-t3          ||j        ¬¦  «        }
|                      |
¦  «         d S d S )Nr   rj  r®  r   r¯  )rC   r  r   rF   rm   r±  rd   rŽ  rƒ  rg  rµ  r»  r¼  rõ   r²  r—  rj  r˜  r´  r¿   r¸  r¹  ra   Úradiusr”  rG  r›  r<   )r   rB   r½  r  ÚindsrÅ  r¾  r¿  rÀ  rÁ  rÆ  s              r    r¡  zRadioButtons._clicked¿  s$  € Ø�;Š;�uÑÔð 	 ¤°Ò!2Ð!2°e´lÀdÄgÒ6MÐ6MØˆFØ”7Ô$×-Ò-Ñ/Ô/×9Ò9¸5¼7ÀEÄGÐ:LÑMÔMˆØ”-×(Ò(¨Ñ/Ô/‰ˆˆ4Ø”×3Ò3Ñ5Ô5×?Ò?ØŒM×%Ò%Ñ'Ô'ñ)ô )ˆàˆ	Ý�4˜Ñ$Ô$ð 		HÝ&¥s¨4¬=¸$¼+Ñ'FÔ'FÑGÔGð Gð G‘	�‘6�A�qØ×'Ò'Ñ)Ô)×2Ò2°5´7¸E¼GÑDÔDð GÝœ9Ÿ>š>¨(°Q´XÑ*=Ñ>Ô>ÀÄÒIÐIÝ#%¤9§>¢>°(¸Q¼XÑ2EÑ#FÔ#F�I˜a‘LøðGõ
 " $¤+Ñ.Ô.ð Hð H‘��1Ø˜˜eœÐ$Ð$Ø×.Ò.Ñ0Ô0×9Ò9¸%¼'À5Ä7ÑKÔKð %å#%¤9§>¢>°(¸VÀA¼YÑ2FÑ#GÔ#G�I˜a‘LøÝˆy‰>Œ>˜AÒÐÝ˜)¨¬Ð7Ñ7Ô7ˆGØ�OŠO˜GÑ$Ô$Ð$Ð$Ð$ð Ðr"   c                 óº   — t          j        t          |¬¦  «         t          |¦  «        }t	          | j        |¦  «        D ]\  }}|                     |¦  «         ŒdS rÈ  rÉ  rË  s       r    rÍ  zRadioButtons.set_label_propsÕ  rÎ  r"   c                 óB  ‡ — t          j        t          |¬¦  «         d|v r=t          j        |                     d¦  «        t          ‰ j        ¦  «        ¦  «        |d<   ‰ j         	                    |¦  «         ‰ j         
                    ¦   «         ‰ _        t          ‰ j        ¦  «        dk    r3t          j        ‰ j        t          ‰ j        ¦  «        d¬¦  «        ‰ _        ‰ j                             ˆ fd„t          ‰ j        ‰ j        ¦  «        D ¦   «         ¦  «         dS )	zó
        Set properties of the `.Text` labels.

        .. versionadded:: 3.7

        Parameters
        ----------
        props : dict
            Dictionary of `.Collection` properties to be used for the radio
            buttons.
        ru  r  rÐ  r   r   rã  c                 óX   •— g | ]&\  }}|                      ¦   «         ‰j        k    r|nd ‘Œ'S rå  )rÞ  rf  )rá   r   rc  r   s      €r    r[  z0RadioButtons.set_radio_props.<locals>.<listcomp>ú  sL   ø€ ð Mð Mð MÙ"��{ð !ŸMšM™OœO¨tÔ/BÒBÐBˆ[ˆ[Èð Mð Mð Mr"   N)r   r’  r“  r¿   rÑ  rœ  r”  r˜  rg  rÊ  r‡   rh  rt  rw   r—  rÒ  s   ` r    Úset_radio_propszRadioButtons.set_radio_propså  s$  ø€ õ 	Ô�d¨%Ð0Ñ0Ô0Ð0Ø�%ˆ<ˆ<Ýœ_¨U¯YªY°s©^¬^½SÀÄÑ=MÔ=MÑNÔNˆE�'‰NØŒ×Ò˜UÑ#Ô#Ð#Ø"œm×9Ò9Ñ;Ô;ˆÔÝˆtÔ"Ñ#Ô# qÒ(Ð(Ý"$¤)¨DÔ,?Ý,/°´Ñ,<Ô,<À1ð#Fñ #Fô #FˆDÔàŒ×#Ò#ðMð Mð Mð MÝ&)¨$¬+°tÔ7JÑ&KÔ&KðMñ Mô Mñ	Nô 	Nð 	Nð 	Nð 	Nr"   c                 ó   — | j         S r   )re  r   s    r    rc  zRadioButtons.activecolorý  s   € àÔ Ð r"   c                 óF  — t          j        |¬¦  «         || _        |                      d|i¦  «         d„ | j        D ¦   «         }t          j        | d¬¦  «        5  |                      |                     | j	        ¦  «        ¦  «         d d d ¦  «         d S # 1 swxY w Y   d S )N)rc  rÚ   c                 ó6   — g | ]}|                      ¦   «         ‘ŒS r5   )rÞ  )rá   rn   s     r    r[  z,RadioButtons.activecolor.<locals>.<listcomp>  s"   € Ð<Ð<Ð< u�%—.’.Ñ"Ô"Ð<Ð<Ð<r"   F)rJ   )
r   Ú_check_color_likere  rr  r˜  r   Ú_setattr_cmr<   rß  rf  )r   rc  r˜  s      r    rc  zRadioButtons.activecolor  sé   € åÔ ¨[Ð9Ñ9Ô9Ð9Ø'ˆÔØ×Ò˜k¨;Ð7Ñ8Ô8Ð8ð =Ð<°´Ð<Ñ<Ô<ˆÝÔ˜t¨eÐ4Ñ4Ô4ð 	?ð 	?Ø�OŠO˜FŸLšL¨Ô)<Ñ=Ô=Ñ>Ô>Ð>ð	?ð 	?ð 	?ñ 	?ô 	?ð 	?ð 	?ð 	?ð 	?ð 	?ð 	?ð 	?øøøð 	?ð 	?ð 	?ð 	?ð 	?ð 	?s   Á.BÂBÂBc                 óˆ  — |t          t          | j        ¦  «        ¦  «        vrt          d|› �¦  «        ‚| j        |                              ¦   «         | _        | j                             ¦   «         }t          j	        d¦  «        |dd…<   t          j	        | j
        |         ¦  «        ||<   | j                             |¦  «         t          | d¦  «        rdt          | j        ¦  «        D ]O\  }}|                     ||k    r| j        nd¦  «         | j        r!| j        r| j                             |¦  «         ŒP| j        r¾| j        rž| j        �| j                             | j        ¦  «         | j                             | j        ¦  «         t          | d¦  «        r$| j        D ]}| j                             |¦  «         Œ| j                             | j        j        ¦  «         n| j                             ¦   «          | j        r:| j                             d| j        |                              ¦   «         ¦  «         dS dS )zv
        Select button with number *index*.

        Callbacks will be triggered if :attr:`eventson` is True.
        zInvalid RadioButton index: r‹  Nrj  re   )rØ  r”  r˜  r&   rÞ  rf  rg  r‡   r   rÙ  rh  rw   rõ   r²  rj  rc  rI   rp   rF   rˆ   r•  rE   rÝ  r‰   rŠ   r‹   rJ   rr   r„   )r   rß  Úbutton_facecolorsr¿  rÀ  s        r    r<   zRadioButtons.set_active  s2  € ð ��c $¤+Ñ.Ô.Ñ/Ô/Ð/Ð/ÝÐB¸5ÐBÐBÑCÔCÐCØ"œk¨%Ô0×9Ò9Ñ;Ô;ˆÔØ œM×7Ò7Ñ9Ô9ÐÝ%œ~¨fÑ5Ô5Ð˜!˜!˜!ÑÝ#)¤>°$Ô2EÀeÔ2LÑ#MÔ#MÐ˜%Ñ ØŒ×#Ò#Ð$5Ñ6Ô6Ð6Ý�4˜Ñ$Ô$ð 	+Ý! $¤-Ñ0Ô0ð +ð +‘��1Ø—’°A¸²J°J Ô 0Ð 0ÀFÑKÔKÐKØ”;ð + 4¤=ð +Ø”G×'Ò'¨Ñ*Ô*Ð*øØŒ;ð 
	#ØŒ}ð 	#ØÔ#Ð/Ø”K×.Ò.¨tÔ/?Ñ@Ô@Ð@Ø”×#Ò# D¤MÑ2Ô2Ð2Ý˜4 Ñ,Ô,ð /Ø!œ]ð /ð /˜Øœ×+Ò+¨AÑ.Ô.Ð.Ð.Ø”× Ò  ¤¤Ñ.Ô.Ð.Ð.à”× Ò Ñ"Ô"Ð"àŒ=ð 	NØŒO×#Ò# I¨t¬{¸5Ô/A×/JÒ/JÑ/LÔ/LÑMÔMÐMÐMÐMð	Nð 	Nr"   c                 ó8   — | j                              d|¦  «        S )rŽ   re   r’   r”   s     r    r•   zRadioButtons.on_clicked-  s   € ð Œ×&Ò& y°$Ñ7Ô7Ð7r"   c                 ó:   — | j                              |¦  «         dS rî  r—   r™   s     r    r˜   zRadioButtons.disconnect5  rš   r"   rÎ   rï  rð  c                 óf  ‡ ‡— t          ‰ d¦  «        s™t          dt          ‰ j        ¦  «        dz   z  dz
  d¦  «        Šˆˆ fd„t	          t          ‰ j        ¦  «        ¦  «        D ¦   «         x}‰ _        ‰ j                             d¦  «         |D ]}‰ j         	                    |¦  «         Œ‰ j        S )Nrj  r`   r   r
  rõ  c           
      óÌ   •— g | ]`}t          ‰j                             ¦   «         |         d ‰j                             ¦   «         |         ‰‰j        j        ‰j        ¬¦  «        ‘ŒaS )rŒ  )r  rÛ   rÚ   rm  rd   r�  )r   rg  r¼  r‡   rF   rm   rp   )rá   r¿  rm  r   s     €€r    r[  z(RadioButtons.circles.<locals>.<listcomp>?  sv   ø€ ð '2ð '2ð '2ð
 õ	 ˜$œ-×3Ò3Ñ5Ô5°aÔ8ÀGØ!%¤×!<Ò!<Ñ!>Ô!>¸qÔ!AØ$°´Ô0AØ $¤ð/ñ /ô /ð'2ð '2ð '2r"   F)
rõ   rG  r”  r˜  rØ  rj  rg  rÛ  rF   rü   )r   Úcirclesrk  rm  s   `  @r    r~  zRadioButtons.circles9  sÒ   øø€ õ �t˜ZÑ(Ô(ð 
	*Ý˜�s 4¤;Ñ/Ô/°!Ñ3Ñ4°sÑ:¸CÑ@Ô@ˆFð'2ð '2ð '2ð '2ð '2õ
 �s 4¤;Ñ/Ô/Ñ0Ô0ð'2ñ '2ô '2ð 2ˆG�d”mð ŒM×%Ò% eÑ,Ô,Ð,Ø!ð *ð *�Ø”×!Ò! &Ñ)Ô)Ð)Ð)ØŒ}Ðr"   )r   N)r1   r2   r3   r4   r!   r¢  r¡  rÍ  rr  rK   rc  Úsetterr<   r•   r˜   r   r  r~  r›   rœ   s   @r    r\  r\  ;  sX  ø€ € € € € ðð ð,aFØ¨4¸TðaFð aFð aFð aFð aFð aFð aFðF,ð ,ð ,ð%ð %ð %ð,ð ð ð Nð Nð Nð0 ð!ð !ñ „Xð!ð Ôð?ð ?ñ Ôð?ðNð Nð NðB8ð 8ð 8ð(ð (ð (ð €T„_�UØHðJñ Jô Jàðð ñ „XñJô Jðð ð ð ð r"   r\  c                   ó$   — e Zd ZdZd„ Zd„ Zd„ ZdS )ÚSubplotToolzN
    A tool to adjust the subplot params of a `matplotlib.figure.Figure`.
    c                 ó  — || _         || _        |                     dd¬¦  «         |                     d¦  «         g | _        g d¢}t          ||                     t          |¦  «        dz   ¦  «        ¦  «        D ]u\  }}|                     d¦  «         t          ||ddt          |j        |¦  «        ¬	¦  «        }|                     | j        ¦  «         | j                             |¦  «         Œv|j        d
                              ¦   «          | j        \  | _        | _        | _        | _        | _        | _        | j        | j        | j        | j        fD ]	}d|_        Œ
| j        | j        fD ]	}d|_        Œ
| j        | j        _        | j        | j        _        | j        | j        _        | j        | j        _        |                     g d¢¦  «        }t9          |d¦  «        | _        | j                             | j        ¦  «         dS )zÔ
        Parameters
        ----------
        targetfig : `.Figure`
            The figure instance to adjust.
        toolfig : `.Figure`
            The figure instance to embed the subplot tool into.
        çš™™™™™É?gÍÌÌÌÌÌì?)rô   ró   z'Click on slider to adjust subplot param)rô   rï   ró   rò   ÚwspaceÚhspacer   Fr   )rÉ   r~  )gš™™™™™é?rõ  r�  g333333³?ÚResetN) rG   Ú	targetfigÚsubplots_adjustÚsuptitleÚ_slidersr—  Úsubplotsr”  rv   rÍ   rC  Úsubplotparsr&  Ú_on_slider_changedrR   ÚaxesÚremoveÚ
sliderleftÚsliderbottomÚsliderrightÚ	slidertopÚsliderwspaceÚsliderhspacer¨   r§   rø   r÷   Úadd_axesr[   Úbuttonresetr•   Ú	_on_reset)r   r‡  ÚtoolfigÚnamesr¥   rF   ÚsliderÚbaxs           r    r!   zSubplotTool.__init__P  s  € ð ˆŒØ"ˆŒØ×Ò S°ÐÑ4Ô4Ð4Ø×ÒÐBÑCÔCÐCàˆŒØFÐFÐFˆå˜E 7×#3Ò#3µC¸±J´JÀ±NÑ#CÔ#CÑDÔDð 	)ð 	)‰HˆD�"Ø�OŠO˜EÑ"Ô"Ð"Ý˜B  a¨Ý$+¨IÔ,AÀ4Ñ$HÔ$HðJñ Jô JˆFà×Ò˜dÔ5Ñ6Ô6Ð6ØŒM× Ò  Ñ(Ô(Ð(Ð(ØŒ�RÔ×ÒÑ!Ô!Ð!à15´ñ	/ˆŒ˜$Ô+¨TÔ-=¸t¼~Ø	Ô	˜DÔ-Ø”¨Ô(9ØÔ(¨$Ô*;ð=ð 	%ð 	%ˆFà$ˆFÔÐØÔ'¨¬Ð8ð 	%ð 	%ˆFØ$ˆFÔÐð %)Ô$4ˆŒÔ!Ø%)¤_ˆÔÔ"Ø&*¤nˆÔÔ#Ø#'Ô#4ˆŒÔ à×ÒÐ7Ð7Ð7Ñ8Ô8ˆÝ! # wÑ/Ô/ˆÔØÔ×#Ò# D¤NÑ3Ô3Ð3Ð3Ð3r"   c                 ó–   —  | j         j        di d„ | j        D ¦   «         ¤Ž | j        r | j         j                             ¦   «          d S d S )Nc                 óL   — i | ]!}|j                              ¦   «         |j        “Œ"S r5   )rn   rÞ  rÄ   )rá   r›  s     r    rä   z2SubplotTool._on_slider_changed.<locals>.<dictcomp>}  s:   € ð ,ð ,ð ,Øð Œ|×$Ò$Ñ&Ô&¨¬
ð ,ð ,ð ,r"   r5   )r‡  rˆ  rŠ  rI   rE   r‹   )r   r  s     r    r�  zSubplotTool._on_slider_changed{  sv   € Ø&ˆŒÔ&ð 	-ð 	-ð,ð ,Ø!œ]ð,ñ ,ô ,ð	-ð 	-ð 	-ð Œ;ð 	)ØŒNÔ!×&Ò&Ñ(Ô(Ð(Ð(Ð(ð	)ð 	)r"   c           	      ó´  — t          ¦   «         5 }|                     t          j        | d¬¦  «        ¦  «         | j        D ],}|                     t          j        |dd¬¦  «        ¦  «         Œ-| j        D ]}|                     ¦   «          Œ	 d d d ¦  «         n# 1 swxY w Y   | j        r|j                             ¦   «          |  	                    d ¦  «         d S )NF)rI   )rI   rJ   )
r   rF  r   rw  rŠ  rË   rI   rE   r‹   r�  )r   rB   rI  r›  s       r    r˜  zSubplotTool._on_reset‚  s.  € Ý‰[Œ[ð 
	˜Eð ×Ò¥Ô 1°$¸uÐ EÑ EÔ EÑFÔFÐFØœ-ð Mð M�Ø×#Ò#ÝÔ% f°UÀUÐKÑKÔKñMô Mð Mð Mð œ-ð ð �Ø—’‘”��ðð
	ð 
	ð 
	ñ 
	ô 
	ð 
	ð 
	ð 
	ð 
	ð 
	ð 
	øøøð 
	ð 
	ð 
	ð 
	ð Œ;ð 	 ØŒL×ÒÑÔÐØ×Ò Ñ%Ô%Ð%Ð%Ð%s   �A<BÂBÂBN)r1   r2   r3   r4   r!   r�  r˜  r5   r"   r    r�  r�  K  sL   € € € € € ðð ð)4ð )4ð )4ðV)ð )ð )ð&ð &ð &ð &ð &r"   r�  c                   ód   ‡ — e Zd ZdZ ej        dd¦  «        d
ˆ fd„	¦   «         Zd„ Zd„ Zd	„ Z	ˆ xZ
S )ÚCursora>  
    A crosshair cursor that spans the Axes and moves with mouse cursor.

    For the cursor to remain responsive you must keep a reference to it.

    Parameters
    ----------
    ax : `matplotlib.axes.Axes`
        The `~.axes.Axes` to attach the cursor to.
    horizOn : bool, default: True
        Whether to draw the horizontal line.
    vertOn : bool, default: True
        Whether to draw the vertical line.
    useblit : bool, default: False
        Use blitting for faster drawing if supported by the backend.
        See the tutorial :doc:`/tutorials/advanced/blitting` for details.

    Other Parameters
    ----------------
    **lineprops
        `.Line2D` properties that control the appearance of the lines.
        See also `~.Axes.axhline`.

    Examples
    --------
    See :doc:`/gallery/widgets/cursor`.
    rÎ   ÚhorizOnTFc                 óî  •— t          ¦   «                              |¦  «         |                      d| j        ¦  «         |                      d| j        ¦  «         d| _        || _        || _        |o| j        j	        | _
        | j
        rd|d<    |j        |                     ¦   «         d         fddi|¤Ž| _         |j        |                     ¦   «         d         fddi|¤Ž| _        d | _        d| _        d S )Nrj   r‘  Tr�  r   r  F)rk   r!   rU   ÚonmoveÚclearr  r¢  ÚvertOnrE   ro   r^   rÿ   Ú
get_yboundÚlinehr  Ú
get_xboundÚlinevÚ
backgroundÚ	needclear)r   rF   r¢  r¦  r^   Ú	linepropsr}   s         €r    r!   zCursor.__init__¯  sô   ø€ õ 	‰Œ×Ò˜ÑÔÐà×ÒÐ0°$´+Ñ>Ô>Ð>Ø×Ò˜<¨¬Ñ4Ô4Ð4àˆŒØˆŒØˆŒØÐ< 4¤;Ô#<ˆŒàŒ<ð 	)Ø$(ˆI�jÑ!Ø�R”Z §¢¡¤°Ô 2ÐOÐO¸EÐOÀYÐOÐOˆŒ
Ø�R”Z §¢¡¤°Ô 2ÐOÐO¸EÐOÀYÐOÐOˆŒ
àˆŒØˆŒˆˆr"   c                 óÀ   — |                       |¦  «        s|                      ¦   «         rdS | j        r+| j                             | j        j        ¦  «        | _        dS dS )z+Internal event handler to clear the cursor.N)rC   rH   r^   rE   r©  rF   rŠ   r«  rA   s     r    r¥  zCursor.clearÄ  sd   € à�;Š;�uÑÔð 	 ×!5Ò!5Ñ!7Ô!7ð 	ØˆFØŒ<ð 	GØ"œk×8Ò8¸¼¼ÑFÔFˆDŒOˆOˆOð	Gð 	Gr"   c                 óè  — |                       |¦  «        rdS | j        j                             | ¦  «        sdS |j        | j        k    r]| j                             d¦  «         | j                             d¦  «         | j	        r | j         
                    ¦   «          d| _	        dS d| _	        | j                             |j        |j        f¦  «         | j                             | j        o| j        ¦  «         | j                             |j        |j        f¦  «         | j                             | j        o| j        ¦  «         | j        r$| j        s| j        r|                      ¦   «          dS dS dS )z?Internal event handler to draw the cursor when the mouse moves.NFT)rC   rE   Ú
widgetlockr%   r   rF   rª  rÛ  r¨  r¬  r‹   r  r  r  r¦  r  r  r¢  rº   rA   s     r    r¤  zCursor.onmoveË  sd  € à�;Š;�uÑÔð 	ØˆFØŒ{Ô%×/Ò/°Ñ5Ô5ð 	ØˆFØŒ<˜4œ7Ò"Ð"ØŒJ×"Ò" 5Ñ)Ô)Ð)ØŒJ×"Ò" 5Ñ)Ô)Ð)àŒ~ð 'Ø”× Ò Ñ"Ô"Ð"Ø!&�”ØˆFØˆŒàŒ
×Ò˜eœk¨5¬;Ð7Ñ8Ô8Ð8ØŒ
×Ò˜tœ|Ð;°´Ñ<Ô<Ð<àŒ
×Ò˜eœk¨5¬;Ð7Ñ8Ô8Ð8ØŒ
×Ò˜tœ|Ð<°´Ñ=Ô=Ð=àŒ<ð 	˜Tœ[ð 	¨D¬Lð 	Ø�LŠL‰NŒNˆNˆNˆNð	ð 	ð 	ð 	r"   c                 óX  — | j         r‰| j        �| j                             | j        ¦  «         | j                             | j        ¦  «         | j                             | j        ¦  «         | j                             | j        j	        ¦  «         n| j         
                    ¦   «          dS ©NF)r^   r«  rE   rÝ  rF   rˆ   rª  r¨  r‰   rŠ   r!  r   s    r    rº   zCursor._updateä  s’   € ØŒ<ð 	$ØŒÐ*Ø”×*Ò*¨4¬?Ñ;Ô;Ð;ØŒG×Ò ¤
Ñ+Ô+Ð+ØŒG×Ò ¤
Ñ+Ô+Ð+ØŒK×Ò˜TœWœ\Ñ*Ô*Ð*Ð*àŒK×!Ò!Ñ#Ô#Ð#Øˆur"   )TTF)r1   r2   r3   r4   r   r(  r!   r¥  r¤  rº   r›   rœ   s   @r    r¡  r¡  “  s“   ø€ € € € € ðð ð6 €TÔ˜E 9Ñ-Ô-ðð ð ð ð ñ .Ô-ðð(Gð Gð Gðð ð ð2	ð 	ð 	ð 	ð 	ð 	ð 	r"   r¡  c                   óî   — e Zd ZdZ ej        dd¦  «        dd„¦   «         Z ej        d¦  «        Z  ej	        d¦  «        d„ ¦  «        Z
  ej	        d¦  «        d	„ ¦  «        Zd
„ Zd„ Zd„ Zd„ Zd„ ZdS )ÚMultiCursoraÖ  
    Provide a vertical (default) and/or horizontal line cursor shared between
    multiple Axes.

    For the cursor to remain responsive you must keep a reference to it.

    Parameters
    ----------
    canvas : object
        This parameter is entirely unused and only kept for back-compatibility.

    axes : list of `matplotlib.axes.Axes`
        The `~.axes.Axes` to attach the cursor to.

    useblit : bool, default: True
        Use blitting for faster drawing if supported by the backend.
        See the tutorial :doc:`/tutorials/advanced/blitting`
        for details.

    horizOn : bool, default: False
        Whether to draw the horizontal line.

    vertOn : bool, default: True
        Whether to draw the vertical line.

    Other Parameters
    ----------------
    **lineprops
        `.Line2D` properties that control the appearance of the lines.
        See also `~.Axes.axhline`.

    Examples
    --------
    See :doc:`/gallery/widgets/multicursor`.
    ú3.6r^   TFc                 óâ  ‡‡‡— || _         || _        || _        || _        d„ |D ¦   «         | _        |d                              ¦   «         \  }}|d                              ¦   «         \  }	}
d||z   z  Šd|	|
z   z  Šd| _        |ot          d„ | j        D ¦   «         ¦  «        | _	        | j	        rd‰d<   ˆˆfd„|D ¦   «         | _
        ˆˆfd„|D ¦   «         | _        |                      ¦   «          d S )	Nc                 ó.   — i | ]}|j         j        g d dœ“ŒS )N)Úcidsr«  )rG   rE   )rá   rF   s     r    rä   z(MultiCursor.__init__.<locals>.<dictcomp>   s:   € ð Oð Oð OØCEˆBŒIÔ r¸Ð>Ð>ðOð Oð Or"   r~  r`   Tc              3   ó$   K  — | ]}|j         V — Œd S r   )ro   )rá   rE   s     r    ú	<genexpr>z'MultiCursor.__init__.<locals>.<genexpr>+  s%   è è € ÐJÐJ¨V�FÔ(ÐJÐJÐJÐJÐJÐJr"   r�  c                 ó0   •— g | ]} |j         ‰fd di‰¤Ž‘ŒS ©r  F)r  )rá   rF   r­  Úxmids     €€r    r[  z(MultiCursor.__init__.<locals>.<listcomp>0  óB   ø€ ð 'ð 'ð 'Øð "�r”z $ÐCÐC°ÐC¸ÐCÐCð 'ð 'ð 'r"   c                 ó0   •— g | ]} |j         ‰fd di‰¤Ž‘ŒS r¼  )rÿ   )rá   rF   r­  Úymids     €€r    r[  z(MultiCursor.__init__.<locals>.<listcomp>2  r¾  r"   )Ú_canvasrŽ  r¢  r¦  Ú_canvas_infosÚget_xlimÚget_ylimr  Úallr^   r  Úhlinesr“   )r   rE   rŽ  r^   r¢  r¦  r­  ÚxminÚxmaxÚyminÚymaxr½  rÀ  s         `    @@r    r!   zMultiCursor.__init__  sT  øøø€ ð
 ˆŒàˆŒ	ØˆŒØˆŒðOð OØIMðOñ Oô OˆÔð ˜"”X×&Ò&Ñ(Ô(‰
ˆˆdØ˜"”X×&Ò&Ñ(Ô(‰
ˆˆdØ�d˜T‘kÑ"ˆØ�d˜T‘kÑ"ˆàˆŒàð KÝÐJÐJ°tÔ7IÐJÑJÔJÑJÔJð 	Œð Œ<ð 	)Ø$(ˆI�jÑ!ð'ð 'ð 'ð 'ð 'Ø!%ð'ñ 'ô 'ˆŒð'ð 'ð 'ð 'ð 'Ø!%ð'ñ 'ô 'ˆŒð 	�Š‰Œˆˆˆr"   c                 óX   — | j         r"| j        | j         d         j        j                 nd S )Nr   )rŽ  Ú_backgroundsrG   rE   r   s    r    r‘   zMultiCursor.<lambda>8  s*   € Ø9=¼ÐLˆÔ˜$œ) Aœ,Ô-Ô4Ô5Ð5Èð r"   rÎ   c                 ó   — dS r²  r5   r   s    r    r‘   zMultiCursor.<lambda>:  s   € °E€ r"   c                 ó¶   — | j                              ¦   «         D ]>\  }}|                     d| j        ¦  «        |                     d| j        ¦  «        g|d<   Œ?dS )zConnect events.rj   r‘  r¸  N)rÂ  rú   rQ   r¤  r¥  )r   rE   Úinfos      r    r“   zMultiCursor.connect<  sf   € à Ô.×4Ò4Ñ6Ô6ð 	ð 	‰LˆF�Dà×"Ò"Ð#8¸$¼+ÑFÔFØ×"Ò" <°´Ñ<Ô<ðˆD�‰LˆLð	ð 	r"   c                 ó¸   — | j                              ¦   «         D ]?\  }}|d         D ]}|                     |¦  «         Œ|d                              ¦   «          Œ@dS )zDisconnect events.r¸  N)rÂ  rú   rW   r¥  )r   rE   rÏ  rT   s       r    r˜   zMultiCursor.disconnectD  sq   € à Ô.×4Ò4Ñ6Ô6ð 	!ð 	!‰LˆF�DØ˜F”|ð +ð +�Ø×%Ò% cÑ*Ô*Ð*Ð*Ø�ŒL×ÒÑ Ô Ð Ð ð	!ð 	!r"   c                 óæ   — |                       |¦  «        rdS | j        rP| j                             ¦   «         D ]8\  }}||j        j        urŒ|                     |j        j        ¦  «        |d<   Œ7dS dS )zClear the cursor.Nr«  )rC   r^   rÂ  rú   rG   rE   r©  rŠ   )r   rB   rE   rÏ  s       r    r¥  zMultiCursor.clearK  s—   € à�;Š;�uÑÔð 	ØˆFØŒ<ð 	OØ $Ô 2× 8Ò 8Ñ :Ô :ð Oð O‘�˜ð
  ¤Ô!5Ð5Ð5ØØ%+×%:Ò%:¸6¼=Ô;MÑ%NÔ%N��\Ñ"Ð"ð	Oð 	OðOð Or"   c                 ó  — |                       |¦  «        s-|j        | j        vs|j        j                             | ¦  «        sd S | j        D ]D}|                     |j        |j        f¦  «         | 	                    | j
        o| j        ¦  «         ŒE| j        D ]D}|                     |j        |j        f¦  «         | 	                    | j
        o| j        ¦  «         ŒE| j
        r$| j        s| j        r|                      ¦   «          d S d S d S r   )rC   r   rŽ  rE   r°  r%   r  r  r  rÛ  r  r¦  rÆ  r  r  r¢  rº   )r   rB   Úlines      r    r¤  zMultiCursor.onmoveY  s  € Ø�KŠK˜ÑÔð 	Ø”< t¤yÐ0Ð0Ø”|Ô.×8Ò8¸Ñ>Ô>ð 1àˆFØ”Kð 	;ð 	;ˆDØ�NŠN˜EœK¨¬Ð5Ñ6Ô6Ð6Ø×Ò˜Tœ\Ð9¨d¬kÑ:Ô:Ð:Ð:Ø”Kð 	<ð 	<ˆDØ�NŠN˜EœK¨¬Ð5Ñ6Ô6Ð6Ø×Ò˜Tœ\Ð:¨d¬lÑ;Ô;Ð;Ð;ØŒ<ð 	˜Tœ[ð 	¨D¬Lð 	Ø�LŠL‰NŒNˆNˆNˆNð	ð 	ð 	ð 	r"   c                 ó  — | j         rÚ| j                             ¦   «         D ](\  }}|d         r|                     |d         ¦  «         Œ)| j        r5t          | j        | j        ¦  «        D ]\  }}|                     |¦  «         Œ| j	        r5t          | j        | j
        ¦  «        D ]\  }}|                     |¦  «         Œ| j        D ]}|                     ¦   «          Œd S | j        D ]}|                     ¦   «          Œd S )Nr«  )r^   rÂ  rú   rÝ  r¦  r—  rŽ  r  rˆ   r¢  rÆ  r‰   r!  )r   rE   rÏ  rF   rÓ  s        r    rº   zMultiCursor._updateg  s3  € ØŒ<ð 	#Ø $Ô 2× 8Ò 8Ñ :Ô :ð >ð >‘�˜Ø˜Ô%ð >Ø×)Ò)¨$¨|Ô*<Ñ=Ô=Ð=øØŒ{ð )Ý # D¤I¨t¬{Ñ ;Ô ;ð )ð )‘H�B˜Ø—N’N 4Ñ(Ô(Ð(Ð(ØŒ|ð )Ý # D¤I¨t¬{Ñ ;Ô ;ð )ð )‘H�B˜Ø—N’N 4Ñ(Ô(Ð(Ð(ØÔ,ð ð �Ø—’‘”��ðð ð Ô,ð #ð #�Ø× Ò Ñ"Ô"Ð"Ð"ð#ð #r"   N)TFT)r1   r2   r3   r4   r   r(  r!   Údeprecate_privatize_attributerE   r  r«  r¬  r“   r˜   r¥  r¤  rº   r5   r"   r    r´  r´  ð  sü   € € € € € ð"ð "ðH €TÔ˜E 9Ñ-Ô-ðð ð ñ .Ô-ððB 0ˆTÔ/°Ñ6Ô6€FØ'��” Ñ'Ô'ð )Nð )Nñ Oô O€Jà&��” Ñ&Ô&Ð'9Ð'9Ñ:Ô:€Iðð ð ð!ð !ð !ðOð Oð Oðð ð ð#ð #ð #ð #ð #r"   r´  c                   óB  ‡ — e Zd Z	 	 d%ˆ fd„	Z ej        d¦  «        Zˆ fd„Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zed„ ¦   «         Zej        d„ ¦   «         Zd„ Z d„ Z!ed„ ¦   «         Z"d „ Z#d!„ Z$d"„ Z%d#„ Z&d$„ Z'ˆ xZ(S )&Ú_SelectorWidgetFNc                 óâ  •— t          ¦   «                              |¦  «         d| _        || _        |o| j        j        | _        |                      ¦   «          t          ddddd¬¦  «        | _	        | j	         
                    |pi ¦  «         || _        d | _        t          |t          ¦  «        r	|g| _        n|| _        d| _        d | _        d | _        d | _        t)          ¦   «         | _        d S )	NTú ÚescapeÚshiftÚcontrolrÐ   )Úmover¥  Úsquarera   ÚrotateF)rk   r!   Ú_visibleÚonselectrE   ro   r^   Úconnect_default_eventsr“  Ú_state_modifier_keysrÊ  Ú_use_data_coordinatesr«  r´   r   ÚvalidButtonsÚ_selection_completedÚ_eventpressÚ_eventreleaseÚ_prev_eventr  Ú_state)r   rF   rá  r^   r  Ústate_modifier_keysÚuse_data_coordinatesr}   s          €r    r!   z_SelectorWidget.__init__{  s÷   ø€ å‰Œ×Ò˜ÑÔÐàˆŒØ ˆŒØÐ< 4¤;Ô#<ˆŒØ×#Ò#Ñ%Ô%Ð%å$(¨c¸Ø07À	Ø03ð%5ñ %5ô %5ˆÔ!ð 	Ô!×(Ò(Ð)<Ð)BÀÑCÔCÐCØ%9ˆÔ"àˆŒå�f�hÑ'Ô'ð 	'Ø!' ˆDÔÐà &ˆDÔð %*ˆÔ!ð  ˆÔà!ˆÔØˆÔÝ‘e”eˆŒˆˆr"   rµ  c                 ó|   •— t          ¦   «                              |¦  «         |r|                      d ¦  «         d S d S r   )rk   r<   Úupdate_background)r   r;   r}   s     €r    r<   z_SelectorWidget.set_active�  sG   ø€ Ý‰Œ×Ò˜6Ñ"Ô"Ð"Øð 	)Ø×"Ò" 4Ñ(Ô(Ð(Ð(Ð(ð	)ð 	)r"   c                 óŒ   ‡ — t          ˆ fd„‰ j                             ¦   «                              ¦   «         D ¦   «         ¦  «        S )aG  
        Convenience method to get all animated artists of the figure containing
        this widget, excluding those already present in self.artists.
        The returned tuple is not sorted by 'z_order': z_order sorting is
        valid only when considering all artists and not only a subset of all
        artists.
        c              3   ó„   •K  — | ]:}|                      ¦   «         D ]#}|                     ¦   «         r|‰j        v¯|V — Œ$Œ;d S r   )Úget_childrenÚget_animatedÚartists)rá   Úax_Úar   s      €r    rº  z8_SelectorWidget._get_animated_artists.<locals>.<genexpr>ª  ss   øè è € ð Dð D˜3Ø!×.Ò.Ñ0Ô0ðDð DØØŸšÑ(Ô(ðDà-.°d´lÐ-BÐ-Bð à-BÐ-BÐ-BÐ-BÐ-BðDð Dr"   )ÚtuplerF   Ú
get_figureÚget_axesr   s   `r    Ú_get_animated_artistsz%_SelectorWidget._get_animated_artists¢  s`   ø€ õ ð Dð Dð Dð D $¤'×"4Ò"4Ñ"6Ô"6×"?Ò"?Ñ"AÔ"Að Dñ Dô Dñ Dô Dð 	Dr"   c                 ó  — | j         sdS t          | j        |                      ¦   «         z   d„ ¬¦  «        }t	          d„ |D ¦   «         ¦  «        }t          ¦   «         5 }|rG|D ]+}|                     |                     d¬¦  «        ¦  «         Œ,| j         	                    ¦   «          | j         
                    | j        j        ¦  «        | _        ddd¦  «         n# 1 swxY w Y   |r|D ]}| j                             |¦  «         ŒdS dS )z"Force an update of the background.Nc                 ó*   — |                       ¦   «         S r   ©Ú
get_zorder©rõ  s    r    r‘   z3_SelectorWidget.update_background.<locals>.<lambda>¼  s   €  q§|¢|¡~¤~€ r"   r¯  c              3   ó>   K  — | ]}|                      ¦   «         V — Œd S r   ©rÜ  )rá   Úartists     r    rº  z4_SelectorWidget.update_background.<locals>.<genexpr>½  s.   è è € ÐFÐF°F˜6×-Ò-Ñ/Ô/ÐFÐFÐFÐFÐFÐFr"   F)r  )r^   Úsortedró  rù  rÈ   r   rF  Ú_cm_setrE   r‹   r©  rF   rŠ   r«  rˆ   )r   rB   ró  Úneeds_redrawrI  r  s         r    rî  z!_SelectorWidget.update_background®  s  € ð Œ|ð 	ØˆFõ ˜œ¨×(BÒ(BÑ(DÔ(DÑDØ5Ð5ð7ñ 7ô 7ˆåÐFÐF¸gÐFÑFÔFÑFÔFˆÝ‰[Œ[ð 	G˜EØð #Ø%ð Gð G�FØ×'Ò'¨¯ª¸u¨Ñ(EÔ(EÑFÔFÐFÐFØ”× Ò Ñ"Ô"Ð"Ø"œk×8Ò8¸¼¼ÑFÔFˆDŒOð	Gð 	Gð 	Gñ 	Gô 	Gð 	Gð 	Gð 	Gð 	Gð 	Gð 	Gøøøð 	Gð 	Gð 	Gð 	Gð ð 	,Ø!ð ,ð ,�Ø”×#Ò# FÑ+Ô+Ð+Ð+ð	,ð 	,ð,ð ,s   ÁA3CÃC Ã#C c                 ó€  — |                       d| j        ¦  «         |                       d| j        ¦  «         |                       d| j        ¦  «         |                       d| j        ¦  «         |                       d| j        ¦  «         |                       d| j        ¦  «         |                       d| j        ¦  «         dS )	z+Connect the major canvas events to methods.rj   rh   ri   r‘  r  Úkey_release_eventÚscroll_eventN)rU   r¤  Úpressr+   rî  Úon_key_pressÚon_key_releaseÚ	on_scrollr   s    r    râ  z&_SelectorWidget.connect_default_eventsÈ  s¸   € à×ÒÐ0°$´+Ñ>Ô>Ð>Ø×ÒÐ/°´Ñ<Ô<Ð<Ø×ÒÐ1°4´<Ñ@Ô@Ð@Ø×Ò˜<¨Ô)?Ñ@Ô@Ð@Ø×ÒÐ,¨dÔ.?Ñ@Ô@Ð@Ø×ÒÐ.°Ô0CÑDÔDÐDØ×Ò˜>¨4¬>Ñ:Ô:Ð:Ð:Ð:r"   c                 óŠ  — | j         r| j                             ¦   «         sdS | j        j                             | ¦  «        sdS t          |d¦  «        sd |_        | j        �|j        | j        vrdS | j	        €|j
        | j        k    S |j        | j	        j        k    rdS |j
        | j        k    p|j        | j	        j        k    S )NTr  F)r;   rF   rÜ  rE   r°  r%   rõ   r  rå  rç  r   rA   s     r    rC   z_SelectorWidget.ignoreÒ  s×   € àŒ{ð 	 $¤'×"5Ò"5Ñ"7Ô"7ð 	Ø�4àŒ{Ô%×/Ò/°Ñ5Ô5ð 	Ø�4Ý�u˜hÑ'Ô'ð 	 ØˆEŒLð ÔÐ)Ø”L¨Ô(9Ð9Ð9Ø�4ð ÔÐ#Ø”< 4¤7Ò*Ð*àŒ<˜4Ô+Ô2Ò2Ð2Ø�5à” ¤Ò'ð 8Ø” Ô 0Ô 7Ò7ð	9r"   c                 ó  — | j                              ¦   «         r| j         j                             ¦   «         €dS | j        r­| j        � | j                             | j        ¦  «         n|                      d¦  «         t          | j
        |                      ¦   «         z   d„ ¬¦  «        }|D ]}| j                              |¦  «         Œ| j                             | j         j        ¦  «         dS | j                             ¦   «          dS )z@Draw using blit() or draw_idle(), depending on ``self.useblit``.Nc                 ó*   — |                       ¦   «         S r   rü  rþ  s    r    r‘   z(_SelectorWidget.update.<locals>.<lambda>ù  s   € ¨1¯<ª<©>¬>€ r"   r¯  )rF   rÜ  rG   r+  r^   r«  rE   rÝ  rî  r  ró  rù  rˆ   r‰   rŠ   r!  )r   ró  r  s      r    rÊ  z_SelectorWidget.updateë  s  € à”×#Ò#Ñ%Ô%ð 	Ø””×,Ò,Ñ.Ô.Ð6ØˆFØŒ<ð 	$ØŒÐ*Ø”×*Ò*¨4¬?Ñ;Ô;Ð;Ð;à×&Ò& tÑ,Ô,Ð,õ ˜Tœ\¨D×,FÒ,FÑ,HÔ,HÑHØ!9Ð!9ð;ñ ;ô ;ˆGà!ð ,ð ,�Ø”×#Ò# FÑ+Ô+Ð+Ð+ØŒK×Ò˜TœWœ\Ñ*Ô*Ð*Ð*Ð*àŒK×!Ò!Ñ#Ô#Ð#Ð#Ð#r"   c                 óÔ   — |j         €dS t          j        |j         g| j                             ¦   «         ¢R Ž }t          j        |j        g| j                             ¦   «         ¢R Ž }||fS )z/Get the xdata and ydata for event, with limits.N)NN)r  r¿   ÚcliprF   r©  r  r§  )r   rB   r  r  s       r    Ú	_get_dataz_SelectorWidget._get_data 	  sg   € àŒ;ÐØ�:Ý”˜œÐ; d¤g×&8Ò&8Ñ&:Ô&:Ð;Ð;Ð;ˆÝ”˜œÐ; d¤g×&8Ò&8Ñ&:Ô&:Ð;Ð;Ð;ˆØ�eˆ|Ðr"   c                 óž   — |j         €| j        }nt          j        |¦  «        }|                      |¦  «        \  |_         |_        || _        |S )zÔ
        Preprocess an event:

        - Replace *event* by the previous event if *event* has no ``xdata``.
        - Clip ``xdata`` and ``ydata`` to the axes limits.
        - Update the previous event.
        )r  ré  Úcopyr  r  rA   s     r    Ú_clean_eventz_SelectorWidget._clean_event	  sL   € ð Œ;ÐØÔ$ˆEˆEå”I˜eÑ$Ô$ˆEØ#'§>¢>°%Ñ#8Ô#8Ñ ˆŒ�U”[Ø ˆÔØˆr"   c                 ó8  — |                       |¦  «        s„|                      |¦  «        }|| _        || _        |j        pd}|                     dd¦  «        }|| j        d         k    r| j                             d¦  «         |  	                    |¦  «         dS dS )z#Button press handler and validator.r  ÚctrlrÜ  rÝ  TF)
rC   r  rç  ré  r°  Úreplacerã  rê  ÚaddÚ_press)r   rB   r°  s      r    r  z_SelectorWidget.press	  sš   € à�{Š{˜5Ñ!Ô!ð 
	Ø×%Ò% eÑ,Ô,ˆEØ$ˆDÔØ$ˆDÔØ”)�/˜rˆCØ—+’+˜f iÑ0Ô0ˆCà�dÔ/°Ô7Ò7Ð7Ø”—’ Ñ'Ô'Ð'Ø�KŠK˜ÑÔÐØ�4Øˆur"   c                 ó   — dS )úButton press event handler.Nr5   rA   s     r    r  z_SelectorWidget._press'	  ó   € € € r"   c                 óô   — |                       |¦  «        sb| j        r[|                      |¦  «        }|| _        |                      |¦  «         d| _        d| _        | j                             d¦  «         dS dS )z+Button release event handler and validator.NrÝ  TF)rC   rç  r  rè  rt   rê  ÚdiscardrA   s     r    r+   z_SelectorWidget.release*	  s}   € à�{Š{˜5Ñ!Ô!ð 	 dÔ&6ð 	Ø×%Ò% eÑ,Ô,ˆEØ!&ˆDÔØ�MŠM˜%Ñ Ô Ð Ø#ˆDÔØ!%ˆDÔØŒK×Ò Ñ'Ô'Ð'Ø�4Øˆur"   c                 ó   — dS )úButton release event handler.Nr5   rA   s     r    rt   z_SelectorWidget._release6	  r  r"   c                 ó–   — |                       |¦  «        s3| j        r,|                      |¦  «        }|                      |¦  «         dS dS ©z(Cursor move event handler and validator.TF)rC   rç  r  Ú_onmoverA   s     r    r¤  z_SelectorWidget.onmove9	  sO   € à�{Š{˜5Ñ!Ô!ð 	 dÔ&6ð 	Ø×%Ò% eÑ,Ô,ˆEØ�LŠL˜ÑÔÐØ�4Øˆur"   c                 ó   — dS )úCursor move event handler.Nr5   rA   s     r    r#  z_SelectorWidget._onmoveA	  r  r"   c                 ó^   — |                       |¦  «        s|                      |¦  «         dS dS )z)Mouse scroll event handler and validator.N)rC   Ú
_on_scrollrA   s     r    r  z_SelectorWidget.on_scrollD	  s8   € à�{Š{˜5Ñ!Ô!ð 	#Ø�OŠO˜EÑ"Ô"Ð"Ð"Ð"ð	#ð 	#r"   c                 ó   — dS )zMouse scroll event handler.Nr5   rA   s     r    r'  z_SelectorWidget._on_scrollI	  r  r"   c                 óø  — | j         rò|j        pd}|                     dd¦  «        }|| j        d         k    r|                      ¦   «          dS | j                             ¦   «         D ]{\  }}||                     d¦  «        v r_|dk    r?|| j        v r| j                             |¦  «         ŒF| j         	                    |¦  «         Œa| j         	                    |¦  «         Œ||  
                    |¦  «         dS dS )z@Key press event handler and validator for all selection widgets.r  r  rÜ  r¥  Nú+rß  )r;   r°  r  rã  r¥  rú   Úsplitrê  r  r  Ú_on_key_press©r   rB   r°  ÚstateÚmodifiers        r    r	  z_SelectorWidget.on_key_pressL	  s
  € àŒ;ð 	&Ø”)�/˜rˆCØ—+’+˜f iÑ0Ô0ˆCØ�dÔ/°Ô8Ò8Ð8Ø—
’
‘”�Ø�Ø%)Ô%>×%DÒ%DÑ%FÔ%Fð 
/ð 
/Ñ!�˜Ø˜sŸyšy¨™~œ~Ð-Ð-ð  Ò(Ð(Ø  D¤KÐ/Ð/Ø œK×/Ò/°Ñ6Ô6Ð6Ð6à œKŸOšO¨EÑ2Ô2Ð2Ð2àœŸš¨Ñ.Ô.Ð.øØ×Ò˜uÑ%Ô%Ð%Ð%Ð%ð#	&ð 	&r"   c                 ó   — dS )z@Key press event handler - for widget-specific key press actions.Nr5   rA   s     r    r,  z_SelectorWidget._on_key_pressa	  r  r"   c                 ó   — | j         rv|j        pd}| j                             ¦   «         D ]<\  }}||                     d¦  «        v r |dk    r| j                             |¦  «         Œ=|                      |¦  «         dS dS )z(Key release event handler and validator.r  r*  rß  N)r;   r°  rã  rú   r+  rê  r  Ú_on_key_releaser-  s        r    r
  z_SelectorWidget.on_key_released	  s–   € àŒ;ð 	(Ø”)�/˜rˆCØ%)Ô%>×%DÒ%DÑ%FÔ%Fð /ð /Ñ!�˜ð ˜sŸyšy¨™~œ~Ð-Ð-°%¸8Ò2CÐ2CØ”K×'Ò'¨Ñ.Ô.Ð.øØ× Ò  Ñ'Ô'Ð'Ð'Ð'ð	(ð 	(r"   c                 ó   — dS )úKey release event handler.Nr5   rA   s     r    r2  z_SelectorWidget._on_key_releaseo	  r  r"   c                 óR   — || _         | j        D ]}|                     |¦  «         ŒdS )z+Set the visibility of the selector artists.N)rà  ró  rÛ  )r   r  r  s      r    rÛ  z_SelectorWidget.set_visibler	  s;   € àˆŒØ”lð 	(ð 	(ˆFØ×Ò˜wÑ'Ô'Ð'Ð'ð	(ð 	(r"   c                 ó   — | j         S )z+Get the visibility of the selector artists.)rà  r   s    r    rÜ  z_SelectorWidget.get_visiblex	  s
   € àŒ}Ðr"   c                 ó*   — |                       ¦   «         S r   r   r   s    r    r  z_SelectorWidget.visible|	  s   € à×ÒÑ!Ô!Ð!r"   c                 ó\   — t          j        dd¬¦  «         |                      |¦  «         d S )Nrµ  rÛ  )Úalternative)r   Úwarn_deprecatedrÛ  )r   r  s     r    r  z_SelectorWidget.visible€	  s2   € åÔ˜U°Ð>Ñ>Ô>Ð>Ø×Ò˜Ñ!Ô!Ð!Ð!Ð!r"   c                 óV   — |                       ¦   «          |                      ¦   «          dS )zAClear the selection and set the selector ready to make a new one.N)Ú_clear_without_updaterÊ  r   s    r    r¥  z_SelectorWidget.clear…	  s%   € à×"Ò"Ñ$Ô$Ð$Ø�Š‰Œˆˆˆr"   c                 ó>   — d| _         |                      d¦  «         d S r²  )ræ  rÛ  r   s    r    r<  z%_SelectorWidget._clear_without_updateŠ	  s$   € Ø$)ˆÔ!Ø×Ò˜ÑÔÐÐÐr"   c                 ó:   — t          | dd¦  «        }| j        f|z   S )z%Tuple of the artists of the selector.Ú_handles_artistsr5   )rC  Ú_selection_artist)r   Úhandles_artistss     r    ró  z_SelectorWidget.artistsŽ	  s'   € õ " $Ð(:¸BÑ?Ô?ˆØÔ&Ð(¨?Ñ:Ð:r"   c                 óÂ   — | j         }t          j        ||¦  «        } |j        di |¤Ž | j        r|                      ¦   «          | j                             |¦  «         dS )zŸ
        Set the properties of the selector artist. See the `props` argument
        in the selector docstring to know which properties are supported.
        Nr5   )r@  r   rp  r  r^   rÊ  Ú_props)r   rv  r  s      r    Ú	set_propsz_SelectorWidget.set_props”	  si   € ð
 Ô'ˆÝÔ& u¨fÑ5Ô5ˆØˆŒ
ÐÐ�UÐÐÐØŒ<ð 	Ø�KŠK‰MŒMˆMØŒ×Ò˜5Ñ!Ô!Ð!Ð!Ð!r"   c                 ó   — t          | d¦  «        st          d¦  «        ‚| j        d         }t          j        ||¦  «        }| j        D ]} |j        di |¤Ž Œ| j        r|                      ¦   «          | j                             |¦  «         dS )z¶
        Set the properties of the handles selector artist. See the
        `handle_props` argument in the selector docstring to know which
        properties are supported.
        r?  z#This selector doesn't have handles.r   Nr5   )	rõ   ÚNotImplementedErrorr?  r   rp  r  r^   rÊ  Ú_handle_props)r   Úhandle_propsr  r`  s       r    Úset_handle_propsz _SelectorWidget.set_handle_props 	  s§   € õ �tÐ/Ñ0Ô0ð 	MÝ%Ð&KÑLÔLÐLàÔ& qÔ)ˆÝÔ-¨l¸FÑCÔCˆØÔ+ð 	'ð 	'ˆFØˆFŒJÐ&Ð&˜Ð&Ð&Ð&Ð&ØŒ<ð 	Ø�KŠK‰MŒMˆMØÔ×!Ò! ,Ñ/Ô/Ð/Ð/Ð/r"   c                 óx   — d„ | j                              ¦   «         D ¦   «         }t          j        ||¬¦  «         d S )Nc                 ó0   — g | ]\  }}|d k    ¯|dk    ¯|‘ŒS )r¥  únot-applicabler5   )rá   r°  Úvalues      r    r[  z3_SelectorWidget._validate_state.<locals>.<listcomp>²	  s:   € ð ð ð Ù�C˜Ø�gŠ~ˆ~ %Ð+;Ò";Ð";ð Ø";Ð";Ð";r"   )r.  )rã  rú   r   r¦   )r   r.  Úsupported_states      r    Ú_validate_statez_SelectorWidget._validate_state±	  sM   € ðð Ø"&Ô";×"AÒ"AÑ"CÔ"Cðñ ô ˆõ 	Ô˜?°%Ð8Ñ8Ô8Ð8Ð8Ð8r"   c                 ód   — |                       |¦  «         | j                             |¦  «         dS )a   
        Add a state to define the widget's behavior. See the
        `state_modifier_keys` parameters for details.

        Parameters
        ----------
        state : str
            Must be a supported state of the selector. See the
            `state_modifier_keys` parameters for details.

        Raises
        ------
        ValueError
            When the state is not supported by the selector.

        N)rO  rê  r  ©r   r.  s     r    Ú	add_statez_SelectorWidget.add_state¸	  s2   € ð" 	×Ò˜UÑ#Ô#Ð#ØŒ�Š˜ÑÔÐÐÐr"   c                 ód   — |                       |¦  «         | j                             |¦  «         dS )a£  
        Remove a state to define the widget's behavior. See the
        `state_modifier_keys` parameters for details.

        Parameters
        ----------
        state : str
            Must be a supported state of the selector. See the
            `state_modifier_keys` parameters for details.

        Raises
        ------
        ValueError
            When the state is not supported by the selector.

        N)rO  rê  r�  rQ  s     r    Úremove_statez_SelectorWidget.remove_stateÌ	  s4   € ð" 	×Ò˜UÑ#Ô#Ð#ØŒ×Ò˜5Ñ!Ô!Ð!Ð!Ð!r"   )FNNF))r1   r2   r3   r!   r   rÕ  rë  r<   rù  rî  râ  rC   rÊ  r  r  r  r  r+   rt   r¤  r#  r  r'  r	  r,  r
  r2  rÛ  rÜ  rK   r  r  r¥  r<  ró  rD  rI  rO  rR  rT  r›   rœ   s   @r    r×  r×  y  so  ø€ € € € € à;?Ø@Eðð ð ð ð ð ð@ =˜$Ô<¸UÑCÔCÐð)ð )ð )ð )ð )ð

Dð 
Dð 
Dð,ð ,ð ,ð4;ð ;ð ;ð9ð 9ð 9ð2$ð $ð $ð*ð ð ðð ð ð ð ð ð*ð *ð *ð
ð 
ð 
ð,ð ,ð ,ðð ð ð)ð )ð )ð#ð #ð #ð
*ð *ð *ð&ð &ð &ð*Oð Oð Oð	(ð 	(ð 	(ð)ð )ð )ð(ð (ð (ðð ð ð ð"ð "ñ „Xð"ð „^ð"ð "ñ „^ð"ðð ð ð
 ð  ð  ð ð;ð ;ñ „Xð;ð

"ð 
"ð 
"ð0ð 0ð 0ð"9ð 9ð 9ðð ð ð("ð "ð "ð "ð "ð "ð "r"   r×  c                   ó<  ‡ — e Zd ZdZ ej        dd¬¦  «        	 	 	 	 	 dˆ fd	„	¦   «         Zd
„ Zd„ Ze	d„ ¦   «         Z
d„ Zˆ fd„Zd„ Ze	d„ ¦   «         Zej        d„ ¦   «         Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zed„ ¦   «         Ze	d„ ¦   «         Zej        d„ ¦   «         Zˆ xZS )ÚSpanSelectora/  
    Visually select a min/max range on a single axis and call a function with
    those values.

    To guarantee that the selector remains responsive, keep a reference to it.

    In order to turn off the SpanSelector, set ``span_selector.active`` to
    False.  To turn it back on, set it to True.

    Press and release events triggered at the same coordinates outside the
    selection will clear the selector, except when
    ``ignore_event_outside=True``.

    Parameters
    ----------
    ax : `matplotlib.axes.Axes`

    onselect : callable
        A callback function that is called after a release event and the
        selection is created, changed or removed.
        It must have the signature::

            def on_select(min: float, max: float) -> Any

    direction : {"horizontal", "vertical"}
        The direction along which to draw the span selector.

    minspan : float, default: 0
        If selection is less than or equal to *minspan*, the selection is
        removed (when already existing) or cancelled.

    useblit : bool, default: False
        If True, use the backend-dependent blitting features for faster
        canvas updates. See the tutorial :doc:`/tutorials/advanced/blitting`
        for details.

    props : dict, optional
        Dictionary of `matplotlib.patches.Patch` properties.
        Default:

            ``dict(facecolor='red', alpha=0.5)``

    onmove_callback : func(min, max), min/max are floats, default: None
        Called on mouse move while the span is being selected.

    span_stays : bool, default: False
        If True, the span stays visible after the mouse is released.
        Deprecated, use *interactive* instead.

    interactive : bool, default: False
        Whether to draw a set of handles that allow interaction with the
        widget after it is drawn.

    button : `.MouseButton` or list of `.MouseButton`, default: all buttons
        The mouse buttons which activate the span selector.

    handle_props : dict, default: None
        Properties of the handle lines at the edges of the span. Only used
        when *interactive* is True. See `matplotlib.lines.Line2D` for valid
        properties.

    grab_range : float, default: 10
        Distance in pixels within which the interactive tool handles can be
        activated.

    state_modifier_keys : dict, optional
        Keyboard modifiers which affect the widget's behavior.  Values
        amend the defaults, which are:

        - "clear": Clear the current shape, default: "escape".

    drag_from_anywhere : bool, default: False
        If `True`, the widget can be moved by clicking anywhere within
        its bounds.

    ignore_event_outside : bool, default: False
        If `True`, the event triggered outside the span selector will be
        ignored.

    snap_values : 1D array-like, optional
        Snap the selector edges to the given values.

    Examples
    --------
    >>> import matplotlib.pyplot as plt
    >>> import matplotlib.widgets as mwidgets
    >>> fig, ax = plt.subplots()
    >>> ax.plot([1, 2, 3], [10, 50, 100])
    >>> def onselect(vmin, vmax):
    ...     print(vmin, vmax)
    >>> span = mwidgets.SpanSelector(ax, onselect, 'horizontal',
    ...                              props=dict(facecolor='blue', alpha=0.5))
    >>> fig.show()

    See also: :doc:`/gallery/widgets/span_selector`
    rÎ   ÚminspanrÏ   r   FNrØ   c                 óv  •— |€t          dddd¬¦  «        }t          ¦   «                              ||||	|¬¦  «         |€t          dd¬¦  «        }| j        |d<   || _        d | _        || _        d | _        || _        || _	        || _
        || _        || _        d | _        || _        || _        d | _        |                      |¦  «         d	|                     d
d¦  «        it'          j        |
t*          ¦  «        ¥| _        | j        r#ddg| _        |                      | j        ¦  «         d | _        d| _        d S )NrÚ  rL  )r¥  rÞ  ra   rß  )r^   r  rë  Úredr`   )rÚ   Úalphar�  rz   rÚ   rÐ   rG  rK  ©r   r   )r“  rk   r!   r^   Ú	directionÚ_extents_on_pressÚsnap_valuesÚ_pressvrC  Úonmove_callbackrW  Ú
grab_rangeÚ_interactiveÚ_edge_handlesÚdrag_from_anywhereÚignore_event_outsiderE   Únew_axesr›  r   rp  r   rG  Ú_edge_orderÚ_setup_edge_handlesr;  Ú_prev)r   rF   rá  r\  rW  r^   rv  r`  Úinteractiver  rH  ra  rë  rd  re  r^  r}   s                   €r    r!   zSpanSelector.__init__C
  su  ø€ ð Ð&Ý"&¨XØ.>Ø.>Ø.>ð#@ñ #@ô #@Ðõ 	‰Œ×Ò˜˜X¨w¸vØ-@ð 	ñ 	Bô 	Bð 	Bð ˆ=Ý 5°Ð4Ñ4Ô4ˆEà œLˆˆjÑà"ˆŒØ!%ˆÔØ&ˆÔð ˆŒàˆŒØ.ˆÔØˆŒà$ˆŒØ'ˆÔØ!ˆÔØ"4ˆÔØ$8ˆÔ!ð ˆŒØ�Š�bÑÔÐð �U—Y’Y˜{¨CÑ0Ô0ð<åÔ$ \µ6Ñ:Ô:ð<ˆÔð Ôð 	9Ø % u˜~ˆDÔØ×$Ò$ TÔ%7Ñ8Ô8Ð8à"ˆÔð ˆŒ
ˆ
ˆ
r"   c                 ó´  — || _         | j        |j        j        ur@| j        �|                      ¦   «          |j        j        | _        |                      ¦   «          d| _        | j        dk    r|                     ¦   «         }d\  }}n|                     ¦   «         }d\  }}t          d||f|ddœ| j
        ¤Ž}| j                              |¦  «         || _        dS )z*Set SpanSelector to operate on a new Axes.NFr¡   r  )r   r   r[  )rd   r  )rF   rE   rG   rY   râ  ræ  r\  r3  r2  r   rC  rü   r@  )r   rF   Útransrø  rZ  Úrect_artists         r    rf  zSpanSelector.new_axes{
  s÷   € àˆŒØŒ;˜bœiÔ.Ð.Ð.ØŒ{Ð&Ø×&Ò&Ñ(Ô(Ð(àœ)Ô*ˆDŒKØ×'Ò'Ñ)Ô)Ð)ð %*ˆÔ!àŒ>˜\Ò)Ð)Ø×*Ò*Ñ,Ô,ˆEØ‰DˆAˆqˆqà×*Ò*Ñ,Ô,ˆEØ‰DˆAˆqÝ ¨¨1ð /Ø*/Ø(-ð/ð /ð #'¤+ð/ð /ˆð
 	Œ×Ò˜+Ñ&Ô&Ð&Ø!,ˆÔÐÐr"   c                 óÒ   — | j         dk    r| j                             ¦   «         }n| j                             ¦   «         }t	          | j        || j         || j        ¬¦  «        | _        d S )Nr¡   )r\  Ú
line_propsr^   )r\  rF   r©  r§  ÚToolLineHandlesr^   rc  )r   rv  Ú	positionss      r    rh  z SpanSelector._setup_edge_handles–
  sj   € àŒ>˜\Ò)Ð)Øœ×*Ò*Ñ,Ô,ˆIˆIàœ×*Ò*Ñ,Ô,ˆIÝ,¨T¬W°iØ7;´~Ø8=Ø59´\ðCñ Cô CˆÔÐÐr"   c                 ó,   — | j         �| j         j        S dS ro  )rc  ró  r   s    r    r?  zSpanSelector._handles_artists¡
  s   € àÔÐ)ØÔ%Ô-Ð-à�2r"   c                 óÐ   — |r.| j         dk    rt          j        j        nt          j        j        }nt          j        j        }| j        j        j         	                    |¦  «         dS )z<Update the canvas cursor based on direction of the selector.r¡   N)
r\  r
   ÚCursorsÚRESIZE_HORIZONTALÚRESIZE_VERTICALÚPOINTERrF   rG   rE   Ú
set_cursor)r   Úenabledr!  s      r    Ú_set_cursorzSpanSelector._set_cursor¨
  sc   € àð 	3àœ¨<Ò7Ð7õ $Ô+Ô=Ð=å#Ô+Ô;ð ˆFõ #Ô*Ô2ˆFàŒŒÔ×(Ò(¨Ñ0Ô0Ð0Ð0Ð0r"   c                 ó¤   •— t          ¦   «                              ¦   «          t          | dd¦  «        r|                      d| j        ¦  «         d S d S )Nrb  Frj   )rk   râ  rC  rU   Ú_hover)r   r}   s    €r    râ  z#SpanSelector.connect_default_events³
  sY   ø€ å‰Œ×&Ò&Ñ(Ô(Ð(Ý�4˜¨Ñ/Ô/ð 	CØ×ÒÐ4°d´kÑBÔBÐBÐBÐBð	Cð 	Cr"   c                 óØ  — |                       d¦  «         | j        r/| j                             ¦   «         r|                      |¦  «         nd| _        | j        �| j        s|                      ¦   «          | j        dk    r|j        n|j	        }|| _
        |                      |¦  «        | _        | j        €| j        sd| _        ||f| _        d| _        n|                      d¦  «         dS )r  TNr¡   F)rz  rb  r@  rÜ  Ú_set_active_handler;  rÊ  r\  r  r  r_  r  ri  re  rà  ÚextentsrÛ  )r   rB   rã   s      r    r  zSpanSelector._press¹
  sò   € à×Ò˜ÑÔÐØÔð 	' Ô!7×!CÒ!CÑ!EÔ!Eð 	'Ø×#Ò# EÑ*Ô*Ð*Ð*à"&ˆDÔàÔÐ&¨dÔ.?Ð&à�KŠK‰MŒMˆMàœ>¨\Ò9Ð9ˆEŒKˆK¸u¼{ˆð ˆŒØ—^’^ EÑ*Ô*ˆŒ
àÔÐ&¨tÔ/HÐ&ð "ˆDŒMØ˜a˜4ˆDŒLð !ˆDŒMˆMà×Ò˜TÑ"Ô"Ð"àˆur"   c                 ó   — | j         S )z;Direction of the span selector: 'vertical' or 'horizontal'.©Ú
_directionr   s    r    r\  zSpanSelector.directionÙ
  ó   € ð ŒÐr"   c                 óx  — t          j        ddg|¬¦  «         t          | d¦  «        rŠ|| j        k    r| j                             ¦   «          | j        r| j                             ¦   «          || _        |                      | j	        ¦  «         | j        r|  
                    | j        ¦  «         dS dS || _        dS )z'Set the direction of the span selector.r¡   r¢   ©r\  r‚  N)r   r¦   rõ   r‚  r@  r�  rb  rc  rf  rF   rh  rG  )r   r\  s     r    r\  zSpanSelector.directionÞ
  sÌ   € õ 	Ô˜L¨*Ð5ÀÐKÑKÔKÐKÝ�4˜Ñ&Ô&ð 
	(¨9¸¼Ò+GÐ+GàÔ"×)Ò)Ñ+Ô+Ð+ØÔ ð ,ØÔ"×)Ò)Ñ+Ô+Ð+Ø'ˆDŒOØ�MŠM˜$œ'Ñ"Ô"Ð"ØÔ ð =Ø×(Ò(¨Ô);Ñ<Ô<Ð<Ð<Ð<ð=ð =ð (ˆDŒOˆOˆOr"   c                 óÆ  — |                       d¦  «         d| _        | j        s| j                             d¦  «         | j        €| j        r	| j        rdS | j        \  }}||z
  }|| j	        k    r:|                      d¦  «         | j        r|  
                    ||¦  «         d| _        n|  
                    ||¦  «         d| _        |                      ¦   «          d| _        dS )r   FNT)rz  r_  rb  r@  rÛ  r;  ræ  re  r  rW  rá  rÊ  )r   rB   rB  rC  Úspans        r    rt   zSpanSelector._releaseî
  sõ   € à×Ò˜ÑÔÐàˆŒàÔ ð 	6ØÔ"×.Ò.¨uÑ5Ô5Ð5àÔÐ'¨DÔ,EÐ'ØÔ)ð (àˆFà”\‰
ˆˆdØ�d‰{ˆà�4”<ÒÐà×Ò˜UÑ#Ô#Ð#ØÔ(ð *à—’˜d DÑ)Ô)Ð)Ø(-ˆDÔ%Ð%à�MŠM˜$ Ñ%Ô%Ð%Ø(,ˆDÔ%à�Š‰Œˆà"ˆÔàˆur"   c                 óà   — |                       |¦  «        rdS | j        €| j        sdS | j                             |j        |j        ¦  «        \  }}|                      || j        k    ¦  «         dS )z/Update the canvas cursor if it's over a handle.N)	rC   r;  ræ  rc  rÆ  rŽ  rƒ  rz  ra  )r   rB   r  Úe_dists       r    r|  zSpanSelector._hover  st   € à�;Š;�uÑÔð 	ØˆFàÔÐ*°$Ô2KÐ*ð
 ˆFàÔ&×.Ò.¨u¬w¸¼Ñ@Ô@‰	ˆˆ6Ø×Ò˜ 4¤?Ò2Ñ3Ô3Ð3Ð3Ð3r"   c                 óî  — |                       |¦  «        | _        | j        dk    r|j        n|j        }| j        dk    r| j        j        }n| j        j        }| j        dk    r!| j        �| j        \  }}||z
  }||z  }||z  }nK| j        r&| j        dk    r| j        \  }}| j        dk    r|}n!|}n| j        r	| j	        rdS ||}}||k    r||}}||f| _
        | j        �|                      ||¦  «         dS )zMotion notify event handler.r¡   ÚCNrG  F)r  ri  r\  r  r  rç  r;  r]  re  ræ  r  r`  )r   rB   rã   ÚvpressrB  rC  Údvs          r    r#  zSpanSelector._onmove  s>  € ð —^’^ EÑ*Ô*ˆŒ
àœ>¨\Ò9Ð9ˆEŒKˆK¸u¼{ˆØŒ>˜\Ò)Ð)ØÔ%Ô+ˆFˆFàÔ%Ô+ˆFð
 Ô #Ò%Ð%¨$Ô*@Ð*LØÔ/‰JˆD�$Ø�V‘ˆBØ�B‰JˆDØ�B‰JˆDˆDð Ô ð 	( TÔ%8¸CÒ%?Ð%?ØÔ/‰JˆD�$ØÔ" eÒ+Ð+Ø��à��ð
 Ô(ð ¨TÔ-Fð Ø�Ø �$ˆDØ�dŠ{ˆ{Ø! 4�d�à˜T�zˆŒàÔÐ+Ø× Ò   tÑ,Ô,Ð,àˆur"   c                 ó  — ||k    r||}}| j         dk    r9| j                             |¦  «         | j                             ||z
  ¦  «         d S | j                             |¦  «         | j                             ||z
  ¦  «         d S )Nr¡   )r\  r@  Úset_xÚ	set_widthÚset_yÚ
set_height©r   rB  rC  s      r    Ú_draw_shapezSpanSelector._draw_shapeK  s‘   € Ø�$Š;ˆ;Ø˜t�$ˆDØŒ>˜\Ò)Ð)ØÔ"×(Ò(¨Ñ.Ô.Ð.ØÔ"×,Ò,¨T°D©[Ñ9Ô9Ð9Ð9Ð9àÔ"×(Ò(¨Ñ.Ô.Ð.ØÔ"×-Ò-¨d°T©kÑ:Ô:Ð:Ð:Ð:r"   c                 óJ  — | j                              |j        |j        ¦  «        \  }}d| j        v rd| _        n]|| j        k    r@d| _        | j        r)|                      |¦  «        rd| _        | j	        | _
        nd| _        dS | j        |         | _        | j	        | _
        dS )ú;Set active handle based on the location of the mouse event.rÝ  r‹  N)rc  rÆ  rŽ  rƒ  rê  r;  ra  rd  Ú	_containsr  r]  rg  )r   rB   Úe_idxr‰  s       r    r~  zSpanSelector._set_active_handleU  s·   € ð Ô*×2Ò2°5´7¸E¼GÑDÔD‰ˆˆvð �T”[Ð Ð Ø"%ˆDÔÐØ�d”oÒ%Ð%à"&ˆDÔØÔ&ð ¨4¯>ª>¸%Ñ+@Ô+@ð à&)�Ô#Ø)-¬�Ô&Ð&à&*�Ô#Ø�ð #'Ô"2°5Ô"9ˆDÔð "&¤ˆÔÐÐr"   c                 óF   — | j                              |d¬¦  «        d         S ©z)Return True if event is within the patch.r   )rm  ©r@  rµ  rA   s     r    r—  zSpanSelector._containso  ó#   € àÔ%×.Ò.¨u¸QÐ.Ñ?Ô?ÀÔBÐBr"   c                 ó´   ‡‡— t          j        t          j        t          j        ‰¦  «        ¦  «        ¦  «        dz  Št	          ˆˆfd„| D ¦   «         ¦  «        S )z2Snap values to a given array values (snap_values).gê-�™—q=c              3   ó¦   •K  — | ]K}‰t          j        ‰|z
  t          j        |¦  «        ‰z  z   ¦  «                             ¦   «                  V — ŒLd S r   )r¿   rÃ   ÚsignrÂ   )rá   rã   Úepsr^  s     €€r    rº  z%SpanSelector._snap.<locals>.<genexpr>x  sh   øè è € ð ð àð �œ˜{¨Q™µ´¸±´¸cÑ1AÑAÑBÔB×IÒIÑKÔKÔLðð ð ð ð ð r"   )r¿   rG  rÃ   Údiffrö  )Úvaluesr^  r   s    `@r    Ú_snapzSpanSelector._snaps  sk   øø€ õ Œf•R”V�BœG KÑ0Ô0Ñ1Ô1Ñ2Ô2°UÑ:ˆÝð ð ð ð ð àðñ ô ñ ô ð 	r"   c                 óö   — | j         dk    r6| j                             ¦   «         }|| j                             ¦   «         z   }n5| j                             ¦   «         }|| j                             ¦   «         z   }||fS )z$Return extents of the span selector.r¡   )r\  r@  Úget_xr¶  Úget_yr·  r“  s      r    r  zSpanSelector.extents|  sw   € ð Œ>˜\Ò)Ð)ØÔ)×/Ò/Ñ1Ô1ˆDØ˜$Ô0×:Ò:Ñ<Ô<Ñ<ˆDˆDàÔ)×/Ò/Ñ1Ô1ˆDØ˜$Ô0×;Ò;Ñ=Ô=Ñ=ˆDØ�TˆzÐr"   c                 ó   — | j         �(t          |                      || j         ¦  «        ¦  «        } | j        |Ž  | j        r| j                             | j        ¦  «         |                      | j	        ¦  «         |  
                    ¦   «          d S r   )r^  rö  r£  r”  rb  rc  Úset_datar  rÛ  rà  rÊ  )r   r  s     r    r  zSpanSelector.extents‡  s†   € ð ÔÐ'Ý˜DŸJšJ w°Ô0@ÑAÔAÑBÔBˆGØˆÔ˜'Ð"Ð"ØÔð 	6àÔ×'Ò'¨¬Ñ5Ô5Ð5Ø×Ò˜œÑ'Ô'Ð'Ø�Š‰Œˆˆˆr"   )r   FNNFNNrØ   NFFN)r1   r2   r3   r4   r   r(  r!   rf  rh  rK   r?  rz  râ  r  r\  r  rt   r|  r#  r”  r~  r—  Ústaticmethodr£  r  r›   rœ   s   @r    rV  rV  á	  sÞ  ø€ € € € € ð_ð _ðB €TÔ˜E¨	Ð2Ñ2Ô2ØCHØ?DØ<>Ø>CØ9=ð	5ð 5ð 5ð 5ð 5ñ 3Ô2ð5ðn-ð -ð -ð6	Cð 	Cð 	Cð ðð ñ „Xðð	1ð 	1ð 	1ðCð Cð Cð Cð Cðð ð ð@ ðð ñ „Xðð Ôð(ð (ñ Ôð(ðð ð ðB4ð 4ð 4ð+ð +ð +ðZ;ð ;ð ;ð.ð .ð .ð4Cð Cð Cð ðð ñ „\ðð ðð ñ „Xðð „^ð	ð 	ñ „^ð	ð 	ð 	ð 	ð 	r"   rV  c                   ó¬   — e Zd ZdZ ej        dd¦  «        	 	 dd„¦   «         Zed„ ¦   «         Zed„ ¦   «         Z	ed	„ ¦   «         Z
d
„ Zd„ Zd„ Zd„ Zd„ ZdS )rp  aƒ  
    Control handles for canvas tools.

    Parameters
    ----------
    ax : `matplotlib.axes.Axes`
        Matplotlib Axes where tool handles are displayed.
    positions : 1D array
        Positions of handles in data coordinates.
    direction : {"horizontal", "vertical"}
        Direction of handles, either 'vertical' or 'horizontal'
    line_props : dict, optional
        Additional line properties. See `matplotlib.lines.Line2D`.
    useblit : bool, default: True
        Whether to use blitting for faster drawing (if supported by the
        backend). See the tutorial :doc:`/tutorials/advanced/blitting`
        for details.
    rÎ   ro  NTc                 óÊ   ‡‡— || _         t          j        ddg|¬¦  «         || _        i ‰�‰ni ¥d|dœ¥Š| j        dk    r|j        n|j        Šˆˆfd„|D ¦   «         | _        d S )Nr¡   r¢   r…  F)r  r�  c                 ó"   •— g | ]} ‰|fi ‰¤Ž‘ŒS r5   r5   )rá   rÀ  Úline_funro  s     €€r    r[  z,ToolLineHandles.__init__.<locals>.<listcomp>¸  s+   ø€ ÐFÐFÐF°q˜˜ !Ð2Ð2 zÐ2Ð2ÐFÐFÐFr"   )rF   r   r¦   r‚  r\  r  rÿ   Ú_artists)r   rF   rq  r\  ro  r^   r­  s       ` @r    r!   zToolLineHandles.__init__¨  s™   øø€ ð ˆŒåÔ˜L¨*Ð5ÀÐKÑKÔKÐKØ#ˆŒð
Ø'Ð3ˆzˆz¸ð
àØð
ð 
ð 
ˆ
ð "&¤°<Ò!?Ð!?�2”:�:ÀRÄZˆàFÐFÐFÐFÐF¸IÐFÑFÔFˆŒˆˆr"   c                 ó*   — t          | j        ¦  «        S r   )rö  r®  r   s    r    ró  zToolLineHandles.artistsº  s   € å�T”]Ñ#Ô#Ð#r"   c                 óH   ‡— | j         dk    rdndŠˆfd„| j        D ¦   «         S )z,Positions of the handle in data coordinates.r¡   r^  rX  c                 óL   •— g | ] } t          |‰¦  «        ¦   «         d          ‘Œ!S rW  )rC  )rá   rÓ  Úmethods     €r    r[  z-ToolLineHandles.positions.<locals>.<listcomp>Â  s1   ø€ ÐDÐDÐD¨tÐ%•˜˜fÑ%Ô%Ñ'Ô'¨Ô*ÐDÐDÐDr"   )r\  ró  )r   r²  s    @r    rq  zToolLineHandles.positions¾  s6   ø€ ð !%¤°,Ò >Ð >��ÀKˆØDÐDÐDÐD°t´|ÐDÑDÔDÐDr"   c                 ó   — | j         S )z4Direction of the handle: 'vertical' or 'horizontal'.r�  r   s    r    r\  zToolLineHandles.directionÄ  rƒ  r"   c                 ó�   — | j         dk    rdnd}t          | j        |¦  «        D ] \  }} t          ||¦  «        ||g¦  «         Œ!dS )zþ
        Set x- or y-positions of handles, depending on if the lines are
        vertical or horizontal.

        Parameters
        ----------
        positions : tuple of length 2
            Set the positions of the handle in data coordinates
        r¡   r  r  N)r\  r—  ró  rC  )r   rq  r²  rÓ  rÀ  s        r    r¨  zToolLineHandles.set_dataÉ  sc   € ð !%¤°,Ò >Ð >��ÀKˆÝ˜4œ<¨Ñ3Ô3ð 	*ð 	*‰GˆD�!Ø!�G�D˜&Ñ!Ô! 1 a &Ñ)Ô)Ð)Ð)ð	*ð 	*r"   c                 óD   — | j         D ]}|                     |¦  «         ŒdS )z/Set the visibility state of the handles artist.N)ró  rÛ  ©r   rM  r  s      r    rÛ  zToolLineHandles.set_visible×  s4   € à”lð 	&ð 	&ˆFØ×Ò˜uÑ%Ô%Ð%Ð%ð	&ð 	&r"   c                 óD   — | j         D ]}|                     |¦  «         ŒdS )z-Set the animated state of the handles artist.N)ró  Úset_animatedr¶  s      r    r¸  zToolLineHandles.set_animatedÜ  s4   € à”lð 	'ð 	'ˆFØ×Ò Ñ&Ô&Ð&Ð&ð	'ð 	'r"   c                 óB   — | j         D ]}|                     ¦   «          ŒdS )z*Remove the handles artist from the figure.N)r®  r�  )r   r  s     r    r�  zToolLineHandles.removeá  s,   € à”mð 	ð 	ˆFØ�MŠM‰OŒOˆOˆOð	ð 	r"   c                 ó4  ‡ — ‰ j         dk    r8t          j        ˆ fd„‰ j        D ¦   «         ¦  «        }t	          ||z
  ¦  «        }n7t          j        ˆ fd„‰ j        D ¦   «         ¦  «        }t	          ||z
  ¦  «        }t          j        |¦  «        }|||         fS )ar  
        Return index and pixel distance to closest handle.

        Parameters
        ----------
        x, y : float
            x, y position from which the distance will be calculated to
            determinate the closest handle

        Returns
        -------
        index, distance : index of the handle and its distance from
            position x, y
        r¡   c                 ó^   •— g | ])}‰j         j                             |d f¦  «        d          ‘Œ*S rW  ©rF   Ú	transDatard   ©rá   rÀ  r   s     €r    r[  z+ToolLineHandles.closest.<locals>.<listcomp>ö  óB   ø€ ð ð ð Ø;<�”Ô!×+Ò+¨Q°¨FÑ3Ô3°AÔ6ðð ð r"   c                 ó^   •— g | ])}‰j         j                             d |f¦  «        d         ‘Œ*S r  r¼  r¾  s     €r    r[  z+ToolLineHandles.closest.<locals>.<listcomp>û  r¿  r"   )r\  r¿   r1  rq  rÃ   rÂ   )r   rŽ  rƒ  Úp_ptsÚdistrß  s   `     r    rÆ  zToolLineHandles.closestæ  sÄ   ø€ ð Œ>˜\Ò)Ð)Ý”Hð ð ð ð Ø@DÄðñ ô ñ ô ˆEõ �u˜q‘y‘>”>ˆDˆDå”Hð ð ð ð Ø@DÄðñ ô ñ ô ˆEõ �u˜q‘y‘>”>ˆDÝ”	˜$‘”ˆØ�d˜5”kÐ!Ð!r"   ©NT)r1   r2   r3   r4   r   r(  r!   rK   ró  rq  r\  r¨  rÛ  r¸  r�  rÆ  r5   r"   r    rp  rp  ”  s÷   € € € € € ðð ð& €TÔ˜E <Ñ0Ô0Ø<@ØðGð Gð Gñ 1Ô0ðGð" ð$ð $ñ „Xð$ð ðEð Eñ „XðEð
 ðð ñ „Xðð*ð *ð *ð&ð &ð &ð
'ð 'ð 'ð
ð ð ð
"ð "ð "ð "ð "r"   rp  c                   ó¤   — e Zd ZdZ ej        dd¦  «        dd„¦   «         Zed„ ¦   «         Zed	„ ¦   «         Z	ed
„ ¦   «         Z
dd„Zd„ Zd„ Zd„ ZdS )ÚToolHandlesa{  
    Control handles for canvas tools.

    Parameters
    ----------
    ax : `matplotlib.axes.Axes`
        Matplotlib Axes where tool handles are displayed.
    x, y : 1D arrays
        Coordinates of control handles.
    marker : str, default: 'o'
        Shape of marker used to display handle. See `matplotlib.pyplot.plot`.
    marker_props : dict, optional
        Additional marker properties. See `matplotlib.lines.Line2D`.
    useblit : bool, default: True
        Whether to use blitting for faster drawing (if supported by the
        backend). See the tutorial :doc:`/tutorials/advanced/blitting`
        for details.
    rÎ   rß   r(   NTc                 óÎ   — || _         |dddddddœt          j        |t          j        ¦  «        ¥}t          ||fd|i|¤Ž| _        | j                              | j        ¦  «         d S )	Né   rø  r‹  r`   FÚ
_nolegend_)rß   Ú
markersizeÚmarkerfacecolorÚ	linestylerZ  r  rn   r�  )rF   r   rp  r   Ú
_alias_mapÚ_markersr  )r   rF   rŽ  rƒ  rß   r
  r^   rv  s           r    r!   zToolHandles.__init__  s�   € àˆŒØ!°ÀsØ$¨s¸uØ&ðLð Lõ Ô)¨,½Ô8IÑJÔJðLˆõ ˜q !Ð?Ð?¨gÐ?¸Ð?Ð?ˆŒØŒ×Ò˜œÑ'Ô'Ð'Ð'Ð'r"   c                 ó4   — | j                              ¦   «         S r   )rÍ  r^  r   s    r    rŽ  zToolHandles.x!  ó   € àŒ}×&Ò&Ñ(Ô(Ð(r"   c                 ó4   — | j                              ¦   «         S r   )rÍ  rX  r   s    r    rƒ  zToolHandles.y%  rÏ  r"   c                 ó   — | j         fS r   )rÍ  r   s    r    ró  zToolHandles.artists)  s   € à”Ð Ð r"   c                 ón   — |�|}t          j        ||g¦  «        }| j                             |¦  «         dS )z!Set x and y positions of handles.N)r¿   r1  rÍ  r¨  )r   Úptsrƒ  rŽ  s       r    r¨  zToolHandles.set_data-  s;   € àˆ=ØˆAÝ”(˜A˜q˜6Ñ"Ô"ˆCØŒ×Ò˜sÑ#Ô#Ð#Ð#Ð#r"   c                 ó:   — | j                              |¦  «         d S r   )rÍ  rÛ  r  s     r    rÛ  zToolHandles.set_visible4  s   € ØŒ×!Ò! #Ñ&Ô&Ð&Ð&Ð&r"   c                 ó:   — | j                              |¦  «         d S r   )rÍ  r¸  r  s     r    r¸  zToolHandles.set_animated7  s   € ØŒ×"Ò" 3Ñ'Ô'Ð'Ð'Ð'r"   c                 óð   — t          j        | j        | j        g¦  «        }| j        j                             |¦  «        }|||gz
  }t          j        |j        Ž }t          j	        |¦  «        }|||         fS )z1Return index and pixel distance to closest index.)
r¿   Úcolumn_stackrŽ  rƒ  rF   r½  rd   ÚhypotÚTrÂ   )r   rŽ  rƒ  rÓ  r¡  rÂ  Ú	min_indexs          r    rÆ  zToolHandles.closest:  si   € åŒo˜tœv t¤vÐ.Ñ/Ô/ˆàŒgÔ×)Ò)¨#Ñ.Ô.ˆØ�a˜�V‰|ˆÝŒx˜œÐ ˆÝ”I˜d‘O”Oˆ	Ø˜$˜yœ/Ð)Ð)r"   )r(   NTr   )r1   r2   r3   r4   r   r(  r!   rK   rŽ  rƒ  ró  r¨  rÛ  r¸  rÆ  r5   r"   r    rÅ  rÅ    sà   € € € € € ðð ð& €TÔ˜E 8Ñ,Ô,ð(ð (ð (ñ -Ô,ð(ð ð)ð )ñ „Xð)ð ð)ð )ñ „Xð)ð ð!ð !ñ „Xð!ð$ð $ð $ð $ð'ð 'ð 'ð(ð (ð (ð*ð *ð *ð *ð *r"   rÅ  u>  
    Parameters
    ----------
    ax : `~matplotlib.axes.Axes`
        The parent axes for the widget.

    onselect : function
        A callback function that is called after a release event and the
        selection is created, changed or removed.
        It must have the signature::

            def onselect(eclick: MouseEvent, erelease: MouseEvent)

        where *eclick* and *erelease* are the mouse click and release
        `.MouseEvent`\s that start and complete the selection.

    minspanx : float, default: 0
        Selections with an x-span less than or equal to *minspanx* are removed
        (when already existing) or cancelled.

    minspany : float, default: 0
        Selections with an y-span less than or equal to *minspanx* are removed
        (when already existing) or cancelled.

    useblit : bool, default: False
        Whether to use blitting for faster drawing (if supported by the
        backend). See the tutorial :doc:`/tutorials/advanced/blitting`
        for details.

    props : dict, optional
        Properties with which the __ARTIST_NAME__ is drawn. See
        `matplotlib.patches.Patch` for valid properties.
        Default:

        ``dict(facecolor='red', edgecolor='black', alpha=0.2, fill=True)``

    spancoords : {"data", "pixels"}, default: "data"
        Whether to interpret *minspanx* and *minspany* in data or in pixel
        coordinates.

    button : `.MouseButton`, list of `.MouseButton`, default: all buttons
        Button(s) that trigger rectangle selection.

    grab_range : float, default: 10
        Distance in pixels within which the interactive tool handles can be
        activated.

    handle_props : dict, optional
        Properties with which the interactive handles (marker artists) are
        drawn. See the marker arguments in `matplotlib.lines.Line2D` for valid
        properties.  Default values are defined in ``mpl.rcParams`` except for
        the default value of ``markeredgecolor`` which will be the same as the
        ``edgecolor`` property in *props*.

    interactive : bool, default: False
        Whether to draw a set of handles that allow interaction with the
        widget after it is drawn.

    state_modifier_keys : dict, optional
        Keyboard modifiers which affect the widget's behavior.  Values
        amend the defaults, which are:

        - "move": Move the existing shape, default: no modifier.
        - "clear": Clear the current shape, default: "escape".
        - "square": Make the shape square, default: "shift".
        - "center": change the shape around its center, default: "ctrl".
        - "rotate": Rotate the shape around its center between -45Â° and 45Â°,
          default: "r".

        "square" and "center" can be combined. The square shape can be defined
        in data or display coordinates as determined by the
        ``use_data_coordinates`` argument specified when creating the selector.

    drag_from_anywhere : bool, default: False
        If `True`, the widget can be moved by clicking anywhere within
        its bounds.

    ignore_event_outside : bool, default: False
        If `True`, the event triggered outside the span selector will be
        ignored.

    use_data_coordinates : bool, default: False
        If `True`, the "square" shape of the selector is defined in
        data coordinates instead of display coordinates.
    Ú__ARTIST_NAME__rý  c                   óf  ‡ — e Zd ZdZddddddddddddddœˆ fd„
Zed	„ ¦   «         Zd
„ Zd„ Zd„ Z	d„ Z
ed„ ¦   «         Zd„ Zd„ Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zej        d„ ¦   «         Zed„ ¦   «         Zej        d„ ¦   «         Zd„ Zd„ Zd„ Zed„ ¦   «         Zˆ xZS )ÚRectangleSelectoraŠ  
    Select a rectangular region of an Axes.

    For the cursor to remain responsive you must keep a reference to it.

    Press and release events triggered at the same coordinates outside the
    selection will clear the selector, except when
    ``ignore_event_outside=True``.

    %s

    Examples
    --------
    >>> import matplotlib.pyplot as plt
    >>> import matplotlib.widgets as mwidgets
    >>> fig, ax = plt.subplots()
    >>> ax.plot([1, 2, 3], [10, 50, 100])
    >>> def onselect(eclick, erelease):
    ...     print(eclick.xdata, eclick.ydata)
    ...     print(erelease.xdata, erelease.ydata)
    >>> props = dict(facecolor='blue', alpha=0.5)
    >>> rect = mwidgets.RectangleSelector(ax, onselect, interactive=True,
    ...                                   props=props)
    >>> fig.show()
    >>> rect.add_state('square')

    See also: :doc:`/gallery/widgets/rectangle_selector`
    r   FNÚdatarØ   )ÚminspanxÚminspanyr^   rv  Ú
spancoordsr  ra  rH  rj  rë  rd  re  rì  c                ó6  •— t          ¦   «                              ||||||¬¦  «         || _        || _        || _        d| _        d| _        d| _        |€t          dddd¬¦  «        }i |¥d	| j	        i¥| _
        | j
                             d
| j        ¦  «        | _         | j        di | j
        ¤Ž}| j                             |¦  «         || _        |                      ¦   «          || _        || _        t)          j        ddg|¬¦  «         || _        |	| _        | j        rñd| j
        pi                      dd¦  «        it3          j        |
t6          ¦  «        ¥| _        g d¢| _        | j        \  }}t?          | j        ||| j        | j	        ¬¦  «        | _         g d¢| _!        | j"        \  }}t?          | j        ||d| j        | j	        ¬¦  «        | _#        | j$        \  }}t?          | j        |g|gd| j        | j	        ¬¦  «        | _%        d | _&        d | _'        d S )N)r^   r  rë  rì  g        ró  TrY  rŒ  rƒ  )rÚ   rÛ   rZ  Úfillr�  r  rÞ  Úpixels©rá  ÚmarkeredgecolorrÛ   )ÚSWÚSEÚNEÚNW)r
  r^   )ÚWÚSÚEÚNr  )rß   r
  r^   r5   )(rk   r!   rb  rd  re  Ú	_rotationÚ_aspect_ratio_correctionÚ_allow_creationr“  r^   rC  rœ  rà  Ú_init_shaperF   rü   r@  Ú_set_aspect_ratio_correctionrß  rà  r   r¦   rá  ra  r›  r   rp  r   rG  Ú_corner_orderÚcornersrÅ  Ú_corner_handlesrg  Úedge_centersrc  ra   Ú_center_handler;  r]  )r   rF   rá  rß  rà  r^   rv  rá  r  ra  rH  rj  rë  rd  re  rì  Úto_drawÚxcÚycÚxeÚyer}   s                        €r    r!   zRectangleSelector.__init__½  sx  ø€ õ
 	‰Œ×Ò˜˜X¨w¸vØ-@Ø.Bð 	ñ 	Dô 	Dð 	Dð (ˆÔØ"4ˆÔØ$8ˆÔ!ØˆŒØ(+ˆÔ%ð
  $ˆÔàˆ=Ý 5°GØ"¨ð/ñ /ô /ˆEà9˜Ð9 
¨D¬LÐ9Ð9ˆŒØœŸš¨	°4´=ÑAÔAˆŒØ"�$Ô"Ð1Ð1 T¤[Ð1Ð1ˆØŒ×Ò˜'Ñ"Ô"Ð"à!(ˆÔØ×)Ò)Ñ+Ô+Ð+à ˆŒØ ˆŒåÔ˜F HÐ-¸*ÐEÑEÔEÐEØ$ˆŒà$ˆŒàÔð 	'à! D¤KÐ$5°2×#:Ò#:Ø ñ$*ô $*ð"@õ Ô(¨µvÑ>Ô>ð"@ˆDÔð
 ":Ð!9Ð!9ˆDÔØ”\‰FˆB�Ý#.¨t¬w¸¸BØ<@Ô<NØ7;´|ð$Eñ $Eô $EˆDÔ ð  4Ð3Ð3ˆDÔØÔ&‰FˆB�Ý!,¨T¬W°b¸"ÀSØ:>Ô:LØ59´\ð"Cñ "Cô "CˆDÔð ”[‰FˆB�Ý"-¨d¬g¸°t¸b¸TÈ#Ø;?Ô;MØ6:´lð#Dñ #Dô #DˆDÔð #'ˆDÔà!%ˆÔÐÐr"   c                 óP   — g | j         j        ¢| j        j        ¢| j        j        ¢R S r   )rø  ró  rö  rc  r   s    r    r?  z"RectangleSelector._handles_artistsÿ  s9   € ð-�Ô$Ô,ð -¨tÔ/CÔ/Kð -ØÔ#Ô+ð-ð -ð 	-r"   c                 ó    — t          ddddœ|¤ŽS )N©r[  r   r   Fra   )r  Úrotation_point)r   rÒ  s     r    rò  zRectangleSelector._init_shape  s+   € Ýð ;¨uØ(0ð;ð ;Ø49ð;ð ;ð 	;r"   c                 óÎ  — | j         r/| j                             ¦   «         r|                      |¦  «         nd| _        | j        �| j         s| j        r|                      ¦   «          | j        €6| j        s/| j        r(|j        }|j	        }d| _
        ||||f| _        d| _
        n|                      d¦  «         | j        | _        | j        | _        |                      ¦   «          dS )r  NFT)rb  r@  rÜ  r~  r;  rñ  rÊ  re  r  r  rà  r  rÛ  r]  rï  Ú_rotation_on_pressró  )r   rB   rŽ  rƒ  s       r    r  zRectangleSelector._press  s÷   € ð Ôð 	' Ô!7×!CÒ!CÑ!EÔ!Eð 	'Ø×#Ò# EÑ*Ô*Ð*Ð*à"&ˆDÔàÔ Ð(°Ô0AÐ(ØÔ$ð )ð �KŠK‰MŒMˆMàÔÐ'°Ô0IÐ'ØÔ$ð (à”ˆAØ”ˆAØ!ˆDŒMØ˜a  A˜:ˆDŒLØ ˆDŒMˆMà×Ò˜TÑ"Ô"Ð"à!%¤ˆÔØ"&¤.ˆÔØ×)Ò)Ñ+Ô+Ð+àˆur"   c                 ó¦  — | j         s| j                             d¦  «         | j        €| j        r	| j        rdS | j        \  }}}}|| j        _        || j        _	        | j
        j                             ||g¦  «        }|\  | j        _        | j        _        || j        _        || j        _	        | j
        j                             ||g¦  «        }|\  | j        _        | j        _        | j        dk    rMt#          | j        j        | j        j        z
  ¦  «        }t#          | j        j	        | j        j	        z
  ¦  «        }	nu| j        dk    rMt#          | j        j        | j        j        z
  ¦  «        }t#          | j        j        | j        j        z
  ¦  «        }	nt%          j        ddg| j        ¬¦  «         || j        k    s|	| j        k    r<| j        r |                      | j        | j        ¦  «         |                      ¦   «          n'|                      | j        | j        ¦  «         d| _        |                      ¦   «          d| _        d| _        dS )r   FNrÞ  rä  rå  T)rb  r@  rÛ  r;  ræ  re  r  rç  r  r  rF   r½  rd   rŽ  rƒ  rè  rá  rÃ   r   r¦   rß  rà  rá  r<  rÊ  r]  )
r   rB   rÂ  r-  rÃ  r,  Úxy0Úxy1ÚspanxÚspanys
             r    rt   zRectangleSelector._release&  s>  € àÔ ð 	6ØÔ"×.Ò.¨uÑ5Ô5Ð5àÔÐ'¨DÔ,EÐ'ØÔ)ð (àˆFð œ‰ˆˆB��BØ!#ˆÔÔØ!#ˆÔÔØŒgÔ×)Ò)¨2¨r¨(Ñ3Ô3ˆØ14Ñ.ˆÔÔ˜DÔ,Ô.à#%ˆÔÔ Ø#%ˆÔÔ ØŒgÔ×)Ò)¨2¨r¨(Ñ3Ô3ˆØ58Ñ2ˆÔÔ˜dÔ0Ô2ð Œ?˜fÒ$Ð$Ý˜Ô(Ô.°Ô1CÔ1IÑIÑJÔJˆEÝ˜Ô(Ô.°Ô1CÔ1IÑIÑJÔJˆEˆEØŒ_ Ò(Ð(Ý˜Ô(Ô*¨TÔ-?Ô-AÑAÑBÔBˆEÝ˜Ô(Ô*¨TÔ-?Ô-AÑAÑBÔBˆEˆEåÔ ¨Ð1Ø*.¬/ð;ñ ;ô ;ð ;ð �D”MÒ!Ð! U¨d¬mÒ%;Ð%;ØÔ(ð Dà—’˜dÔ.°Ô0BÑCÔCÐCØ×&Ò&Ñ(Ô(Ð(Ð(à�MŠM˜$Ô*¨DÔ,>Ñ?Ô?Ð?Ø(,ˆDÔ%à�Š‰ŒˆØ"ˆÔØ!%ˆÔàˆur"   c                 ó^  — | j         }| j        }d|v o| j        | j        v }| j        dk    }| j        o| }|r‚|                      ¦   «                              ¦   «         }|                     |j        |j        g¦  «        \  |_        |_        |                     |j        |j        g¦  «        \  |_        |_        |j        |j        z
  }|j        |j        z
  }	d}
| j	        r||	}}n|j
        |j
        z
  }|j        |j        z
  }| j        \  }}}}|rãt          j        |j        |j        g¦  «        }t          j        | j        ¦  «        }t          j        |j        |j        g¦  «        }t          j        |d         |d         z
  |d         |d         z
  ¦  «        t          j        |d         |d         z
  |d         |d         z
  ¦  «        z
  }t          j        | j        |z   ¦  «        | _        �n­|�r>||z
  ||z
  g}||d         dz  z   ||d         dz  z   g}d|v �rd|v rj| j        | j        v rt)          ||t*          ¬	¦  «        }
| j        d
v s|
|k    r|j        |d         z
  }|| j        z  }n‘|j        |d         z
  }|| j        z  }nv|d         dz  }|d         dz  }| j        ddg| j        z   v rt+          |j        |d         z
  ¦  «        }| j        ddg| j        z   v rt+          |j        |d         z
  ¦  «        }|d         |z
  |d         |z   |d         |z
  |d         |z   f\  }}}}�njd| j        v r|}d| j        v r|}| j        ddg| j        z   v r|j        }| j        ddg| j        z   v r|j        }d|v r®| j        | j        v rt)          ||t*          ¬	¦  «        }
| j        d
v s|
|k    r>t          j        |j        |z
  ¦  «        }||t+          ||z
  ¦  «        z  | j        z  z   }�nªt          j        |j        |z
  ¦  «        }||t+          ||z
  ¦  «        z  | j        z  z   }�nl|r@| j        \  }}}}|j        |j        z
  }|j        |j        z
  }	||z  }||z  }||	z  }||	z  }�n*d| _        | j        r| j        s| j        sdS |j        |j        g}|j        |d         z
  dz  }|j        |d         z
  dz  }	d|v rvt)          ||t*          ¬	¦  «        }
|
|k    r-t          j        |	¦  «        t+          |¦  «        z  | j        z  }	n,t          j        |¦  «        t+          |	¦  «        z  | j        z  }d|v r|dz  }|	dz  }	n |dxx         |z  cc<   |dxx         |	z  cc<   |d         |z
  |d         |z   |d         |	z
  |d         |	z   f\  }}}}||||f| _        dS )z½
        Motion notify event handler.

        This can do one of four things:
        - Translate
        - Rotate
        - Re-size
        - Continue the creation of a new shape
        rß  r‹  Nr   r   r  ra   rÞ  r¯  )rí  rë  rí  rë  rî  rì  ç       @)rç  rê  r;  rô  Ú_get_rotation_transformr±  rd   r  r  rä  rŽ  rƒ  r]  r¿   r1  ra   Úarctan2Úrad2degr  ÚrotationrK  rÃ   rð  rŸ  rï  re  ræ  rñ  r  )r   rB   Ú
eventpressr.  rß  rÝ  ÚresizeÚinv_trÚdxrû  ÚrefmaxÚrefxÚrefyrÂ  r-  rÃ  r,  rõ  ÚbrX   ÚangleÚsize_on_pressra   ÚhwÚhhrŸ  s                             r    r#  zRectangleSelector._onmoveV  sƒ  € ð Ô%ˆ
ð ”ˆØ˜eÐ#ð <ØÔ%¨Ô);Ð;ð 	àÔ" cÒ)ˆØÔ$Ð1¨T¨ˆàð 	Ø×1Ò1Ñ3Ô3×<Ò<Ñ>Ô>ˆFØ'-×'7Ò'7Ø”˜eœkÐ*ñ(,ô (,Ñ$ˆEŒK˜œà17×1AÒ1AØÔ! :Ô#3Ð4ñ2ô 2Ñ.ˆJÔ˜jÔ.ð Œ[˜:Ô+Ñ+ˆØŒ[˜:Ô+Ñ+ˆð ˆØÔ%ð 	*Ø˜R�$ˆDˆDð ”7˜Zœ\Ñ)ˆDØ”7˜Zœ\Ñ)ˆDàÔ/‰ˆˆB��Bàð f	>å”˜*Ô*¨JÔ,<Ð=Ñ>Ô>ˆAÝ”˜œÑ%Ô%ˆAÝ”˜%œ+ u¤{Ð3Ñ4Ô4ˆAÝ”Z  !¤ Q q¤T¡	¨1¨Q¬4°°!´©9Ñ5Ô5Ý”Z  !¤ Q q¤T¡	¨1¨Q¬4°°!´©9Ñ5Ô5ñ6ˆEåœJ tÔ'>ÀÑ'FÑGÔGˆDŒM‰Màñ ]	>Ø "™W b¨2¡gÐ.ˆMØ˜=¨Ô+¨aÑ/Ñ/°°mÀAÔ6FÈÑ6JÑ1JÐKˆFð ˜5Ð Ñ à˜uÐ$Ð$àÔ*¨dÔ.@Ð@Ð@Ý!$ T¨4µSÐ!9Ñ!9Ô!9˜ØÔ*¨jÐ8Ð8¸FÀdºN¸NØ"œ[¨6°!¬9Ñ4˜Ø $Ô"?Ñ?˜˜à"œ[¨6°!¬9Ñ4˜Ø $Ô"?Ñ?˜˜à& qÔ)¨AÑ-�BØ& qÔ)¨AÑ-�BàÔ*¨s°C¨j¸4Ô;MÑ.MÐMÐMÝ  ¤¨v°a¬yÑ!8Ñ9Ô9˜ØÔ*¨s°C¨j¸4Ô;MÑ.MÐMÐMÝ  ¤¨v°a¬yÑ!8Ñ9Ô9˜à"(¨¤)¨b¡.°&¸´)¸b±.Ø"(¨¤)¨b¡.°&¸´)¸b±.ð"B‘��B˜˜B™Bð ˜$Ô-Ð-Ð-Ø�BØ˜$Ô-Ð-Ð-Ø�BØÔ&¨3°¨*°tÔ7IÑ*IÐIÐIØœ�BØÔ&¨3°¨*°tÔ7IÑ*IÐIÐIØœ�BØ˜uÐ$Ð$àÔ*¨dÔ.@Ð@Ð@Ý!$ T¨4µSÐ!9Ñ!9Ô!9˜ØÔ*¨jÐ8Ð8¸FÀdºN¸NÝ!œw u¤{°RÑ'7Ñ8Ô8˜Ø $­¨R°"©W©¬Ñ"5Ø Ô9ñ#:ñ :˜™õ  "œw u¤{°RÑ'7Ñ8Ô8˜Ø $­¨R°"©W©¬Ñ"5Ø Ô9ñ#:ñ :˜ùð ð (	>Ø!Ô3‰NˆB��B˜Ø”˜zÔ/Ñ/ˆBØ”˜zÔ/Ñ/ˆBØ�"‰HˆBØ�"‰HˆBØ�"‰HˆBØ�"‰HˆB‰Bð ˆDŒNð Ô*ð ¨tÔ/Hð ØÔ,ðà�Ø Ô&¨
Ô(8Ð9ˆFØ”+  q¤	Ñ)¨RÑ/ˆBØ”+  q¤	Ñ)¨RÑ/ˆBð ˜5Ð Ð Ý˜T 4­SÐ1Ñ1Ô1�Ø˜T’>�>Ýœ ™œ¥s¨2¡w¤wÑ.°Ô1NÑN�B�Båœ ™œ¥s¨2¡w¤wÑ.°Ô1NÑN�Bð ˜5Ð Ð Ø�a‘�Ø�a‘��ð �q�	�	”	˜R‘�	�	‘	Ø�q�	�	”	˜R‘�	�	‘	à$ Qœi¨"™n¨f°Q¬i¸"©nØ$ Qœi¨"™n¨f°Q¬i¸"©nð>‰NˆB��B˜ð ˜2˜r 2�~ˆŒˆˆr"   c                 ó>   — | j                              ¦   «         j        S r   )r@  Úget_bboxÚboundsr   s    r    Ú
_rect_bboxzRectangleSelector._rect_bboxé  s   € àÔ%×.Ò.Ñ0Ô0Ô7Ð7r"   c                 ó~   — | j                              ¦   «         }|| j        _        | j        r	d| _        d S || _        d S ©Nr   )rF   Ú_get_aspect_ratior@  rð  rä  ©r   Úaspect_ratios     r    ró  z.RectangleSelector._set_aspect_ratio_correctioní  sG   € Ø”w×0Ò0Ñ2Ô2ˆØ:FˆÔÔ7ØÔ%ð 	9Ø,-ˆDÔ)Ð)Ð)à,8ˆDÔ)Ð)Ð)r"   c                 óH  — | j                              ¦   «         } t          ¦   «                              | j        d          | j        d          ¦  «                             d|¦  «                             | j        ¦  «                             dd|z  ¦  «        j        | j        Ž S ©Nr   r   )rF   r!  r   Ú	translatera   Úscalerß  rï  r"  s     r    r  z)RectangleSelector._get_rotation_transformõ  sƒ   € Ø”w×0Ò0Ñ2Ô2ˆð�x‰zŒz×#Ò# T¤[°¤^ O°d´kÀ!´n°_ÑEÔEß’�q˜,Ñ'Ô'ß’˜œÑ'Ô'ß’�q˜!˜lÑ*Ñ+Ô+Ü˜DœKð	)ð 	)r"   c                 óø   — | j         \  }}}}|||z   ||z   |f}||||z   ||z   f}|                      ¦   «         }|                     t          j        ||g¦  «        j        ¦  «        j        }|d         |d         fS )ze
        Corners of rectangle in data coordinates from lower left,
        moving clockwise.
        r   r   ©r  r  rd   r¿   r1  rÙ  )	r   rÂ  rÃ  rö  r÷  rú  rû  rd   rÅ  s	            r    rõ  zRectangleSelector.cornersý  s‹   € ð !%¤ÑˆˆB��vØ��e‘˜R %™Z¨Ð+ˆØ��R˜&‘[ " v¡+Ð-ˆØ×0Ò0Ñ2Ô2ˆ	Ø×$Ò$¥R¤X¨r°2¨hÑ%7Ô%7Ô%9Ñ:Ô:Ô<ˆØ�aŒy˜& œ)Ð#Ð#r"   c                 ó  — | j         \  }}}}|dz  }|dz  }|||z   ||z   ||z   f}||z   |||z   ||z   f}|                      ¦   «         }	|	                     t          j        ||g¦  «        j        ¦  «        j        }
|
d         |
d         fS )zk
        Midpoint of rectangle edges in data coordinates from left,
        moving anti-clockwise.
        r
  r   r   r)  )r   rÂ  rÃ  rö  r÷  rø  rZ  rü  rý  rd   rÅ  s              r    r÷  zRectangleSelector.edge_centers
  s¥   € ð !%¤ÑˆˆB��vØ�B‰JˆØ�R‰KˆØ��a‘˜˜e™ R¨!¡VÐ+ˆØ�!‰V�R˜˜a™  f¡Ð,ˆØ×0Ò0Ñ2Ô2ˆ	Ø×$Ò$¥R¤X¨r°2¨hÑ%7Ô%7Ô%9Ñ:Ô:Ô<ˆØ�aŒy˜& œ)Ð#Ð#r"   c                 ó:   — | j         \  }}}}||dz  z   ||dz  z   fS )z(Center of rectangle in data coordinates.r
  )r  )r   rÂ  rÃ  rö  r÷  s        r    ra   zRectangleSelector.center  s0   € ð !%¤ÑˆˆB��vØ�E˜B‘J‰  V¨b¡[Ñ 0Ð0Ð0r"   c                 ó‚   — | j         \  }}}}t          |||z   g¦  «        \  }}t          |||z   g¦  «        \  }}||||fS )z}
        Return (xmin, xmax, ymin, ymax) in data coordinates as defined by the
        bounding box before rotation.
        )r  r  )	r   rÂ  rÃ  rö  r÷  rÇ  rÈ  rÉ  rÊ  s	            r    r  zRectangleSelector.extents  sW   € ð !%¤ÑˆˆB��vÝ˜R  e¡Ð,Ñ-Ô-‰
ˆˆdÝ˜R  f¡Ð-Ñ.Ô.‰
ˆˆdØ�T˜4 Ð%Ð%r"   c                 ó8  — |                       |¦  «         | j        rO | j        j        | j        Ž   | j        j        | j        Ž  | j        \  }}| j                             |g|g¦  «         |  	                    | j
        ¦  «         |                      ¦   «          d S r   )r”  rb  rö  r¨  rõ  rc  r÷  ra   rø  rÛ  rà  rÊ  )r   r  rŽ  rƒ  s       r    r  zRectangleSelector.extents*  s�   € ð 	×Ò˜Ñ!Ô!Ð!ØÔð 	3à)ˆDÔ Ô)¨4¬<Ð8Ð8Ø'ˆDÔÔ'¨Ô):Ð;Ð;Ø”;‰DˆAˆqØÔ×(Ò(¨!¨¨q¨cÑ2Ô2Ð2Ø×Ò˜œÑ'Ô'Ð'Ø�Š‰Œˆˆˆr"   c                 ó4   — t          j        | j        ¦  «        S )u‹   
        Rotation in degree in interval [-45Â°, 45Â°]. The rotation is limited in
        range to keep the implementation simple.
        )r¿   r  rï  r   s    r    r  zRectangleSelector.rotation7  s   € õ Œz˜$œ.Ñ)Ô)Ð)r"   c                 óp   — d|k    r-|dk    r)t          j        |¦  «        | _        | j        | _        d S d S d S )NiÓÿÿÿé-   )r¿   Údeg2radrï  r  )r   rM  s     r    r  zRectangleSelector.rotation?  s>   € ð �%Š<ˆ<˜E RšK˜KÝœZ¨Ñ.Ô.ˆDŒNàœ<ˆDŒLˆLˆLð ˆ<˜K˜Kr"   c                 óÆ  — |\  }}}}t          ||g¦  «        \  }}t          ||g¦  «        \  }}	t          | j                             ¦   «         ¦  «        }
t          | j                             ¦   «         ¦  «        }t	          |
d         |¦  «        }t	          |d         |¦  «        }t          ||
d         ¦  «        }t          |	|d         ¦  «        }	| j                             |¦  «         | j                             |¦  «         | j         	                    ||z
  ¦  «         | j         
                    |	|z
  ¦  «         | j                             | j        ¦  «         d S r%  )r  rF   rÃ  rÄ  rK  rG  r@  r�  r‘  r�  r’  Ú	set_angler  )r   r  rÂ  r-  rÃ  r,  rÇ  rÈ  rÉ  rÊ  r  r  s               r    r”  zRectangleSelector._draw_shapeH  s>  € Ø ‰ˆˆB��BÝ˜R ˜HÑ%Ô%‰
ˆˆdÝ˜R ˜HÑ%Ô%‰
ˆˆdÝ�d”g×&Ò&Ñ(Ô(Ñ)Ô)ˆÝ�d”g×&Ò&Ñ(Ô(Ñ)Ô)ˆå�4˜”7˜DÑ!Ô!ˆÝ�4˜”7˜DÑ!Ô!ˆÝ�4˜˜aœÑ!Ô!ˆÝ�4˜˜aœÑ!Ô!ˆàÔ×$Ò$ TÑ*Ô*Ð*ØÔ×$Ò$ TÑ*Ô*Ð*ØÔ×(Ò(¨°©Ñ5Ô5Ð5ØÔ×)Ò)¨$°©+Ñ6Ô6Ð6ØÔ×(Ò(¨¬Ñ7Ô7Ð7Ð7Ð7r"   c                 ó(  — | j                              |j        |j        ¦  «        \  }}| j                             |j        |j        ¦  «        \  }}| j                             |j        |j        ¦  «        \  }}d| j        v r	d| _        dS || j        dz  k     r	d| _        dS || j        k    r9|| j        k    r.| j	        r|  
                    |¦  «        r	d| _        dS d| _        dS ||k     r| j        |         | _        dS | j        |         | _        dS )r–  rÝ  r‹  r  N)rö  rÆ  rŽ  rƒ  rc  rø  rê  r;  ra  rd  r—  rô  rg  )r   rB   Úc_idxÚc_distr˜  r‰  Úm_idxÚm_dists           r    r~  z$RectangleSelector._set_active_handleZ  s(  € ð Ô,×4Ò4°U´W¸e¼gÑFÔF‰ˆˆvØÔ*×2Ò2°5´7¸E¼GÑDÔD‰ˆˆvØÔ+×3Ò3°E´G¸U¼WÑEÔE‰ˆˆvà�T”[Ð Ð Ø"%ˆDÔÐÐà�d”o¨Ñ)Ò)Ð)à"%ˆDÔÐÐØ�d”oÒ%Ð%¨&°4´?Ò*BÐ*BàÔ&ð ¨4¯>ª>¸%Ñ+@Ô+@ð à&)�Ô#Ð#Ð#à&*�Ô#Ø�Ø�fŠ_ˆ_à"&Ô"4°UÔ";ˆDÔÐÐð #'Ô"2°5Ô"9ˆDÔÐÐr"   c                 óF   — | j                              |d¬¦  «        d         S rš  r›  rA   s     r    r—  zRectangleSelector._containsv  rœ  r"   c                 óR  — t          | j        d¦  «        rh| j        j                             ¦   «         }|                     | j                             ¦   «         ¦  «        j        \  }}t          j	        ||g¦  «        S t          j	        | j         
                    ¦   «         ¦  «        S )a  
        Return an array of shape (2, 5) containing the
        x (``RectangleSelector.geometry[1, :]``) and
        y (``RectangleSelector.geometry[0, :]``) data coordinates of the four
        corners of the rectangle starting and ending in the top left corner.
        Ú	get_verts)rõ   r@  rF   r½  r±  rd   r;  rÙ  r¿   r1  Úget_data)r   Úxfmrƒ  rŽ  s       r    ÚgeometryzRectangleSelector.geometryz  s‰   € õ �4Ô)¨;Ñ7Ô7ð 	?Ø”'Ô#×,Ò,Ñ.Ô.ˆCØ—=’= Ô!7×!AÒ!AÑ!CÔ!CÑDÔDÔF‰DˆAˆqÝ”8˜Q ˜FÑ#Ô#Ð#å”8˜DÔ2×;Ò;Ñ=Ô=Ñ>Ô>Ð>r"   )r1   r2   r3   r4   r!   rK   r?  rò  r  rt   r#  r  ró  r  rõ  r÷  ra   r  r  r  r”  r~  r—  r>  r›   rœ   s   @r    rÝ  rÝ  �  s  ø€ € € € € ðð ð: 23¸QÈØ¨°tÈØ"°Ø%)¸eØ&+À%ð	@&ð @&ð @&ð @&ð @&ð @&ð @&ðD ð-ð -ñ „Xð-ð;ð ;ð ;ðð ð ð<.ð .ð .ð`Q&ð Q&ð Q&ðf ð8ð 8ñ „Xð8ð9ð 9ð 9ð)ð )ð )ð ð
$ð 
$ñ „Xð
$ð ð$ð $ñ „Xð$ð ð1ð 1ñ „Xð1ð
 ð&ð &ñ „Xð&ð „^ð
ð 
ñ „^ð
ð ð*ð *ñ „Xð*ð „_ð(ð (ñ „_ð(ð8ð 8ð 8ð$:ð :ð :ð8Cð Cð Cð ð?ð ?ñ „Xð?ð ?ð ?ð ?ð ?r"   rÝ  Úellipsec                   ó4   — e Zd ZdZd„ Zd„ Zed„ ¦   «         ZdS )ÚEllipseSelectorao  
    Select an elliptical region of an Axes.

    For the cursor to remain responsive you must keep a reference to it.

    Press and release events triggered at the same coordinates outside the
    selection will clear the selector, except when
    ``ignore_event_outside=True``.

    %s

    Examples
    --------
    :doc:`/gallery/widgets/rectangle_selector`
    c                 ó   — t          dddi|¤ŽS )Nr   r  F)r   rÒ  s     r    rò  zEllipseSelector._init_shapeœ  s   € ÝÐ<Ð<¨UÐ<°eÐ<Ð<Ð<r"   c                 ó&  — |\  }}}}t          ||g¦  «        \  }}t          ||g¦  «        \  }}	|||z
  dz  z   |||z
  dz  z   g}
||z
  dz  }|	|z
  dz  }|
| j        _        d|z  | j        _        d|z  | j        _        | j        | j        _        d S )Nr
  r  )r  r@  ra   rö  r÷  r  r  )r   r  rÂ  r-  rÃ  r,  rÇ  rÈ  rÉ  rÊ  ra   rõ  r  s                r    r”  zEllipseSelector._draw_shapeŸ  sµ   € Ø ‰ˆˆB��BÝ˜R ˜HÑ%Ô%‰
ˆˆdÝ˜R ˜HÑ%Ô%‰
ˆˆdØ˜˜R™ 2‘~Ñ% r¨R°"©W¸©NÑ':Ð;ˆØ�D‰[˜BÑˆØ�D‰[˜BÑˆà(.ˆÔÔ%Ø'(¨1¡uˆÔÔ$Ø()¨A©ˆÔÔ%Ø'+¤}ˆÔÔ$Ð$Ð$r"   c                 ót   — | j         j        \  }}| j         j        }| j         j        }||dz  z
  ||dz  z
  ||fS )Nr
  )r@  ra   rö  r÷  )r   rŽ  rƒ  rö  r÷  s        r    r  zEllipseSelector._rect_bbox¬  sF   € àÔ%Ô,‰ˆˆ1ØÔ&Ô,ˆØÔ'Ô.ˆØ�5˜2‘:‰~˜q 6¨B¡;™°°vÐ=Ð=r"   N)r1   r2   r3   r4   rò  r”  rK   r  r5   r"   r    rA  rA  Š  sW   € € € € € ðð ð=ð =ð =ð5ð 5ð 5ð ð>ð >ñ „Xð>ð >ð >r"   rA  c                   óf   ‡ — e Zd ZdZ ej        dd¬¦  «        dˆ fd„	¦   «         Zd„ Zd	„ Zd
„ Z	ˆ xZ
S )ÚLassoSelectora™  
    Selection curve of an arbitrary shape.

    For the selector to remain responsive you must keep a reference to it.

    The selected path can be used in conjunction with `~.Path.contains_point`
    to select data points from an image.

    In contrast to `Lasso`, `LassoSelector` is written with an interface
    similar to `RectangleSelector` and `SpanSelector`, and will continue to
    interact with the Axes until disconnected.

    Example usage::

        ax = plt.subplot()
        ax.plot(x, y)

        def onselect(verts):
            print(verts)
        lasso = LassoSelector(ax, onselect)

    Parameters
    ----------
    ax : `~matplotlib.axes.Axes`
        The parent Axes for the widget.
    onselect : function
        Whenever the lasso is released, the *onselect* function is called and
        passed the vertices of the selected path.
    useblit : bool, default: True
        Whether to use blitting for faster drawing (if supported by the
        backend). See the tutorial :doc:`/tutorials/advanced/blitting`
        for details.
    props : dict, optional
        Properties with which the line is drawn, see `matplotlib.lines.Line2D`
        for valid properties. Default values are defined in ``mpl.rcParams``.
    button : `.MouseButton` or list of `.MouseButton`, optional
        The mouse buttons used for rectangle selection.  Default is ``None``,
        which corresponds to all buttons.
    rÎ   r^   rÏ   TNc                 óâ   •— t          ¦   «                              ||||¬¦  «         d | _        i |�|ni ¥| j        ddœ¥}t	          g g fi |¤Ž}| j                             |¦  «         || _        d S )N)r^   r  F)r�  r  )rk   r!   rD  r^   r   rF   r  r@  )r   rF   rá  r^   rv  r  rÓ  r}   s          €r    r!   zLassoSelector.__init__Ý  s˜   ø€ å‰Œ×Ò˜˜X¨w¸vÐÑFÔFÐFØˆŒ
ð
ØÐ)ˆuˆu¨rð
ð œ°ð	
ð 
ð 
ˆõ �b˜"Ð&Ð& Ð&Ð&ˆØŒ×Ò˜ÑÔÐØ!%ˆÔÐÐr"   c                 óp   — |                       |¦  «        g| _        | j                             d¦  «         d S rÃ  )r  rD  r@  rÛ  rA   s     r    r  zLassoSelector._pressë  s5   € Ø—n’n UÑ+Ô+Ð,ˆŒ
ØÔ×*Ò*¨4Ñ0Ô0Ð0Ð0Ð0r"   c                 ó  — | j         �G| j                              |                      |¦  «        ¦  «         |                      | j         ¦  «         | j                             g g g¦  «         | j                             d¦  «         d | _         d S r²  )rD  rR   r  rá  r@  r¨  rÛ  rA   s     r    rt   zLassoSelector._releaseï  s}   € ØŒ:Ð!ØŒJ×Ò˜dŸnšn¨UÑ3Ô3Ñ4Ô4Ð4Ø�MŠM˜$œ*Ñ%Ô%Ð%ØÔ×'Ò'¨¨R¨Ñ1Ô1Ð1ØÔ×*Ò*¨5Ñ1Ô1Ð1ØˆŒ
ˆ
ˆ
r"   c                 ó   — | j         €d S | j                              |                      |¦  «        ¦  «         | j                             t          t          | j         Ž ¦  «        ¦  «         |                      ¦   «          d S r   )rD  rR   r  r@  r¨  Úlistr—  rÊ  rA   s     r    r#  zLassoSelector._onmove÷  sh   € ØŒ:ÐØˆFØŒ
×Ò˜$Ÿ.š.¨Ñ/Ô/Ñ0Ô0Ð0ØÔ×'Ò'­­S°$´*Ð-=Ñ(>Ô(>Ñ?Ô?Ð?à�Š‰Œˆˆˆr"   )TNN)r1   r2   r3   r4   r   r(  r!   r  rt   r#  r›   rœ   s   @r    rF  rF  ´  s”   ø€ € € € € ð&ð &ðP €TÔ˜E¨	Ð2Ñ2Ô2ð&ð &ð &ð &ð &ñ 3Ô2ð&ð1ð 1ð 1ðð ð ðð ð ð ð ð ð r"   rF  c                   óü   ‡ — e Zd ZdZ ej        dd¬¦  «        	 	 dddddœˆ fd	„¦   «         Zd
„ Zd„ Zd„ Z	d„ Z
d„ Zed„ ¦   «         Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zed„ ¦   «         Zej        d„ ¦   «         Zˆ xZS )ÚPolygonSelectoraN  
    Select a polygon region of an Axes.

    Place vertices with each mouse click, and make the selection by completing
    the polygon (clicking on the first vertex). Once drawn individual vertices
    can be moved by clicking and dragging with the left mouse button, or
    removed by clicking the right mouse button.

    In addition, the following modifier keys can be used:

    - Hold *ctrl* and click and drag a vertex to reposition it before the
      polygon has been completed.
    - Hold the *shift* key and click and drag anywhere in the Axes to move
      all vertices.
    - Press the *esc* key to start a new polygon.

    For the selector to remain responsive you must keep a reference to it.

    Parameters
    ----------
    ax : `~matplotlib.axes.Axes`
        The parent Axes for the widget.

    onselect : function
        When a polygon is completed or modified after completion,
        the *onselect* function is called and passed a list of the vertices as
        ``(xdata, ydata)`` tuples.

    useblit : bool, default: False
        Whether to use blitting for faster drawing (if supported by the
        backend). See the tutorial :doc:`/tutorials/advanced/blitting`
        for details.

    props : dict, optional
        Properties with which the line is drawn, see `matplotlib.lines.Line2D`
        for valid properties.
        Default:

            ``dict(color='k', linestyle='-', linewidth=2, alpha=0.5)``

    handle_props : dict, optional
        Artist properties for the markers drawn at the vertices of the polygon.
        See the marker arguments in `matplotlib.lines.Line2D` for valid
        properties.  Default values are defined in ``mpl.rcParams`` except for
        the default value of ``markeredgecolor`` which will be the same as the
        ``color`` property in *props*.

    grab_range : float, default: 10
        A vertex is selected (to complete the polygon or to move a vertex) if
        the mouse click is within *grab_range* pixels of the vertex.

    draw_bounding_box : bool, optional
        If `True`, a bounding box will be drawn around the polygon selector
        once it is complete. This box can be used to move and resize the
        selector.

    box_handle_props : dict, optional
        Properties to set for the box handles. See the documentation for the
        *handle_props* argument to `RectangleSelector` for more info.

    box_props : dict, optional
        Properties to set for the box. See the documentation for the *props*
        argument to `RectangleSelector` for more info.

    Examples
    --------
    :doc:`/gallery/widgets/polygon_selector_simple`
    :doc:`/gallery/widgets/polygon_selector_demo`

    Notes
    -----
    If only one point remains after removing points, the selector reverts to an
    incomplete state and you can start drawing a new polygon from the existing
    point.
    rÎ   r^   rÏ   FNrØ   )Údraw_bounding_boxÚbox_handle_propsÚ	box_propsc          	      ó°  •— t          ddddddd¬¦  «        }
t          ¦   «                              ||||
¬¦  «         dg| _        |€t          dd	d
d¬¦  «        }i |¥d| j        i¥| _        t          g g fi | j        ¤Žx| _        }| j         	                    |¦  «         |€*t          d| j         
                    dd¦  «        ¬¦  «        }|| _        t          | j        g g | j        | j        ¬¦  «        | _        d| _        || _        |                      d¦  «         || _        d | _        |€i }| j                             |¦  «        | _        |	| _        d S )NrÚ  rÜ  rÛ  rL  )r¥  Úmove_vertexÚmove_allrÝ  rÞ  ra   rß  )r^   rë  r[  râ   ú-r  r`   )rz   rË  rŠ  rZ  r�  rz   )ræ  rÊ  )r^   r
  r~  T)r“  rk   r!   Ú_xysr^   rC  r   r@  rF   r  r›  rG  rÅ  Ú_polygon_handlesÚ_active_handle_idxra  rÛ  Ú	_draw_boxÚ_boxrÊ  Ú_box_handle_propsÚ
_box_props)r   rF   rá  r^   rv  rH  ra  rN  rO  rP  rë  rÓ  r}   s               €r    r!   zPolygonSelector.__init__M  sœ  ø€ õ #¨¸yØ,3Ð:JØ*:Ø*:Ø*:ð	<ñ <ô <Ðõ
 	‰Œ×Ò˜˜X¨wØ-@ð 	ñ 	Bô 	Bð 	Bð �HˆŒ	àˆ=Ý˜s¨c¸QÀcÐJÑJÔJˆEØ9˜Ð9 
¨D¬LÐ9Ð9ˆŒÝ(.¨r°2Ð(EÐ(E¸¼Ð(EÐ(EÐEˆÔ ØŒ×Ò˜ÑÔÐàÐÝ°Ø04´·²ÀÈÑ0MÔ0MðOñ Oô OˆLà)ˆÔÝ +¨D¬G°R¸Ø48´LØ9=Ô9Kð!Mñ !Mô !MˆÔð #%ˆÔØ$ˆŒà×Ò˜ÑÔÐØ*ˆŒØˆŒ	àÐ#Ø!ÐØ!%Ô!3×!:Ò!:Ð;KÑ!LÔ!LˆÔØ#ˆŒˆˆr"   c                 ó4   — | j                              ¦   «         S r   )r@  r  r   s    r    Ú	_get_bboxzPolygonSelector._get_bbox{  s   € ØÔ%×.Ò.Ñ0Ô0Ð0r"   c           	      ón  — t          | j        d„ | j        | j        | j        | j        d¬¦  «        | _        | j        j                             d¦  «         | j         	                    d| j
        ¦  «         |                      ¦   «          d| j        _        d| j        _        |                      ¦   «          d S )Nc                  ó   — d S r   r5   )Úargsr  s     r    r‘   z*PolygonSelector._add_box.<locals>.<lambda>€  s   € Àt€ r"   T)rá  r^   ra  rH  rv  rj  rß  rj   F)rÝ  rF   r^   ra  rZ  r[  rY  rã  rœ  rU   Ú_scale_polygonÚ_update_boxrñ  ræ  Ú_draw_polygonr   s    r    Ú_add_boxzPolygonSelector._add_box~  s±   € Ý% d¤gØ/KÐ/KØ.2¬lØ15´Ø37Ô3IØ,0¬OØ26ð8ñ 8ô 8ˆŒ	ð 	Œ	Ô&×*Ò*¨8Ñ4Ô4Ð4ØŒ	×ÒÐ 5°tÔ7JÑKÔKÐKØ×ÒÑÔÐð %*ˆŒ	Ô!Ø)-ˆŒ	Ô&Ø×ÒÑÔÐÐÐr"   c                 óZ   — | j         �#| j                              d¦  «         d | _         d S d S r²  )rY  rÛ  r   s    r    Ú_remove_boxzPolygonSelector._remove_box�  s3   € ØŒ9Ð ØŒI×!Ò! %Ñ(Ô(Ð(ØˆDŒIˆIˆIð !Ð r"   c                 óª   — | j         �K|                      ¦   «         }|j        |j        |j        |j        g| j         _        | j         j        | _        d S d S r   )rY  r]  rÂ  r-  rÃ  r,  r  Ú_old_box_extents)r   rŠ   s     r    rb  zPolygonSelector._update_box”  sO   € àŒ9Ð Ø—>’>Ñ#Ô#ˆDØ!%¤¨$¬'°4´7¸D¼GÐ DˆDŒIÔà$(¤IÔ$5ˆDÔ!Ð!Ð!ð	 !Ð r"   c                 óf  — | j         sdS | j        | j        j        k    rdS | j        j        \  }}}}|                      ¦   «         }t          j        ¦   «                              |j	         |j
         ¦  «                             d|j        z  d|j        z  ¦  «                             ||¦  «                             ||¦  «        }d„ |                     t          j        | j        ¦  «        ¦  «        D ¦   «         }g |¢|d         ‘| _        |                      ¦   «          | j        j        | _        dS )z¯
        Scale the polygon selector points when the bounding box is moved or
        scaled.

        This is set as a callback on the bounding box RectangleSelector.
        Nr   c                 ó   — g | ]	\  }}||f‘Œ
S r5   r5   )rá   rŽ  rƒ  s      r    r[  z2PolygonSelector._scale_polygon.<locals>.<listcomp>³  s    € ÐJÐJÐJ¡  1�a˜�VÐJÐJÐJr"   r   )ræ  rh  rY  r  r  r]  r   r   r&  rÂ  rÃ  r'  rö  r÷  rd   r¿   r1  rD  rU  rc  )	r   rB   r-  r,  Úw1Úh1Úold_bboxrÁ  Ú	new_vertss	            r    ra  zPolygonSelector._scale_polygonœ  s  € ð Ô(ð 	ØˆFàÔ  D¤IÔ$5Ò5Ð5ØˆFð œÔ-‰ˆˆB��BØ—>’>Ñ#Ô#ˆÝÔ Ñ"Ô"ßŠi˜œ˜ x¤{ lÑ3Ô3ßŠe�A˜œÑ&¨¨H¬OÑ(;Ñ<Ô<ßŠe�B˜‰mŒmßŠi˜˜BÑÔð	 	
ð KÐJ¨¯ªµB´H¸T¼ZÑ4HÔ4HÑ(IÔ(IÐJÑJÔJˆ	Ø.�iÐ. ¨1¤Ð.ˆŒ	Ø×ÒÑÔÐØ $¤	Ô 1ˆÔÐÐr"   c                 ó   — | j         j        S r   )rV  ró  r   s    r    r?  z PolygonSelector._handles_artists¸  s   € àÔ$Ô,Ð,r"   c                 óÌ  — t          | j        ¦  «        dk    r|| j        ru|dt          | j        ¦  «        dz
  fv rZ| j                             d¦  «         | j                             d¦  «         | j                             | j        d         ¦  «         n| j                             |¦  «         t          | j        ¦  «        dk    rd| _        |                      ¦   «          dS dS )zRemove vertex with index i.r  r   r   r~  FN)r”  rU  ræ  rœ  rR   rf  )r   r¿  s     r    Ú_remove_vertexzPolygonSelector._remove_vertex¼  sÙ   € å�”	‰NŒN˜QÒÐØÔ)ð à�a�˜TœY™œ¨!Ñ+Ð,Ð,Ð,ð ŒI�MŠM˜!ÑÔÐØŒI�MŠM˜"ÑÔÐð ŒI×Ò˜TœY qœ\Ñ*Ô*Ð*Ð*àŒI�MŠM˜!ÑÔÐÝˆtŒy‰>Œ>˜QÒÐð ).ˆDÔ%Ø×ÒÑÔÐÐÐð	 Ðr"   c                 ó  — | j         s	d| j        v rRt          | j        ¦  «        dk    r:| j                             |j        |j        ¦  «        \  }}|| j        k     r|| _	        | j         
                    ¦   «         | _        dS )r  rR  r   N)ræ  rê  r”  rU  rV  rÆ  rŽ  rƒ  ra  rW  r  Ú_xys_at_press)r   rB   Úh_idxÚh_dists       r    r  zPolygonSelector._pressÐ  s   € ð Ô&ð 	0¨-¸4¼;Ð*FÐ*FÝ˜œ	‘N”N QÒ&Ð&Ø Ô1×9Ò9¸%¼'À5Ä7ÑKÔK‰MˆE�6Ø˜œÒ'Ð'Ø*/�Ô'ð "œYŸ^š^Ñ-Ô-ˆÔÐÐr"   c                 ó   — | j         dk    rA|j        dk    r.|                      | j         ¦  «         |                      ¦   «          d| _         nžt	          | j        ¦  «        dk    rF| j        d         | j        d         k    r*d| _        | j        r| j        €|  	                    ¦   «          n@| j        s9d| j
        vr0d| j
        vr'| j                             d|j        |j        f¦  «         | j        r|                      | j        ¦  «         dS dS )r   r   r  r~  TNrS  rR  )rW  r  rq  rc  r”  rU  ræ  rX  rY  rd  rê  Úinsertr  r  rá  rD  rA   s     r    rt   zPolygonSelector._releaseÜ  s  € ð Ô" aÒ'Ð'ØŒ|˜qÒ Ð Ø×#Ò# DÔ$;Ñ<Ô<Ð<Ø×"Ò"Ñ$Ô$Ð$Ø&(ˆDÔ#Ð#õ �”‰^Œ^˜aÒÐ D¤I¨b¤M°T´Y¸q´\Ò$AÐ$AØ(,ˆDÔ%ØŒ~ð   $¤)Ð"3Ø—’‘”�øð Ô+ð 	=Ø D¤KÐ/Ð/Ø t¤{Ð2Ð2ØŒI×Ò˜R %¤+¨u¬{Ð!;Ñ<Ô<Ð<àÔ$ð 	&Ø�MŠM˜$œ*Ñ%Ô%Ð%Ð%Ð%ð	&ð 	&r"   c                 óˆ   — |                       |¦  «        s,|                      |¦  «        }|                      |¦  «         dS dS r"  )rC   r  r#  rA   s     r    r¤  zPolygonSelector.onmoveô  sG   € ð �{Š{˜5Ñ!Ô!ð 	Ø×%Ò% eÑ,Ô,ˆEØ�LŠL˜ÑÔÐØ�4Øˆur"   c                 óX  — | j         dk    rB| j         }|j        |j        f| j        |<   |dk    r| j        r|j        |j        f| j        d<   �nHd| j        v rv| j        ro|j        | j        j        z
  }|j        | j        j        z
  }t          t          | j        ¦  «        ¦  «        D ]$}| j	        |         \  }}||z   ||z   f| j        |<   Œ%nÉ| j        sd| j        v s	d| j        v rdS | j
                             ¦   «                              | j        d         ¦  «        \  }}	t          j        ||j        z
  |	|j        z
  ¦  «        }
t          | j        ¦  «        dk    r!|
| j        k     r| j        d         | j        d<   n|j        |j        f| j        d<   |                      ¦   «          dS )r%  r   r~  rS  rR  Nr  )rW  r  r  rU  ræ  rê  rç  rØ  r”  rs  r@  Úget_transformrd   r¿   rØ  rŽ  rƒ  ra  rc  )r   rB   rS  r  rû  râ   Ú
x_at_pressÚ
y_at_pressrÂ  rÃ  Úv0_dists              r    r#  zPolygonSelector._onmove   sº  € ð Ô" aÒ'Ð'ØÔ)ˆCØ"œ[¨%¬+Ð5ˆDŒI�c‰Nð �aŠxˆx˜DÔ5ˆxØ %¤¨U¬[Ð 8�”	˜"‘ùð ˜4œ;Ð&Ð&¨4Ô+;Ð&Ø”˜tÔ/Ô5Ñ5ˆBØ”˜tÔ/Ô5Ñ5ˆBÝ�3˜tœy™>œ>Ñ*Ô*ð @ð @�Ø)-Ô);¸AÔ)>Ñ&�
˜JØ)¨B™°
¸R±Ð?�”	˜!‘�ð@ð
 Ô'ð 	9Ø $¤+Ð-Ð-°¸t¼{Ð1JÐ1JØˆFð Ô&×4Ò4Ñ6Ô6×@Ò@ÀÄÈ1ÄÑNÔNñ ˆB�å”h˜r E¤G™|¨R°%´'©\Ñ:Ô:ˆGå�4”9‰~Œ~ Ò!Ð! g°´Ò&?Ð&?Ø $¤	¨!¤�”	˜"‘�à %¤¨U¬[Ð 8�”	˜"‘à×ÒÑÔÐÐÐr"   c                 óš   — | j         sAd| j        v s	d| j        v r1| j                             ¦   «          |                      ¦   «          dS dS dS )zKey press event handler.rR  rS  N)ræ  rê  rU  rœ  rc  rA   s     r    r,  zPolygonSelector._on_key_press&  s`   € ð Ô)ð 	!Ø" d¤kÐ1Ð1Ø 4¤;Ð.Ð.ØŒI�MŠM‰OŒOˆOØ×ÒÑ Ô Ð Ð Ð ð		!ð 	!à.Ð.r"   c                 ó  — | j         s‚|j        | j                             d¦  «        k    s#|j        | j                             d¦  «        k    r<| j                             |j        |j        f¦  «         |                      ¦   «          dS |j        | j                             d¦  «        k    r[|  	                    |¦  «        }|j        |j        fg| _        d| _         |  
                    ¦   «          |                      d¦  «         dS dS )r4  rR  rS  r¥  FTN)ræ  r°  rã  r›  rU  rR   r  r  rc  r  rf  rÛ  rA   s     r    r2  zPolygonSelector._on_key_release0  s  € ð Ô)ð 	#à”˜dÔ7×;Ò;¸MÑJÔJÒJÐJØ”I Ô!:×!>Ò!>¸zÑ!JÔ!JÒJÐJØŒI×Ò˜eœk¨5¬;Ð7Ñ8Ô8Ð8Ø×ÒÑ Ô Ð Ð Ð àŒY˜$Ô3×7Ò7¸Ñ@Ô@Ò@Ð@Ø×%Ò% eÑ,Ô,ˆEØœ+ u¤{Ð3Ð4ˆDŒIØ(-ˆDÔ%Ø×ÒÑÔÐØ×Ò˜TÑ"Ô"Ð"Ð"Ð"ð AÐ@r"   c                 óÈ  — | j         rt          | j         Ž ng g f\  }}| j                             ||¦  «         |                      ¦   «          | j        s4t          | j         ¦  «        dk    rH| j         d         | j         d         k    r,| j                             |dd…         |dd…         ¦  «         n| j                             ||¦  «         |                      ¦   «          dS )z5Redraw the polygon based on the new vertex positions.r  r~  r   N)	rU  r—  r@  r¨  rb  ræ  r”  rV  rÊ  )r   Úxsr¤  s      r    rc  zPolygonSelector._draw_polygonB  sØ   € à$(¤IÐ;•�d”i��°B¸°8‰ˆˆBØÔ×'Ò'¨¨BÑ/Ô/Ð/Ø×ÒÑÔÐð Ô%ð 	3Ý˜œ	‘N”N QÒ&Ð&Øœ	 "œ¨¬°1¬Ò5Ð5ØÔ!×*Ò*¨2¨c¨r¨c¬7°B°s¸°s´GÑ<Ô<Ð<Ð<àÔ!×*Ò*¨2¨rÑ2Ô2Ð2Ø�Š‰Œˆˆˆr"   c                 ó    — | j         dd…         S )z4The polygon vertices, as a list of ``(x, y)`` pairs.Nr~  )rU  r   s    r    rD  zPolygonSelector.vertsR  s   € ð Œy˜˜"˜Œ~Ðr"   c                 óÌ   — g |¢|d         ‘| _         d| _        |                      d¦  «         | j        r| j        €|                      ¦   «          |                      ¦   «          dS )zš
        Set the polygon vertices.

        This will remove any preexisting vertices, creating a complete polygon
        with the new vertices.
        r   TN)rU  ræ  rÛ  rX  rY  rd  rc  )r   Úxyss     r    rD  zPolygonSelector.vertsW  si   € ð #�c�N˜3˜qœ6�NˆŒ	Ø$(ˆÔ!Ø×Ò˜ÑÔÐØŒ>ð 	˜dœiÐ/Ø�MŠM‰OŒOˆOØ×ÒÑÔÐÐÐr"   )FNNrØ   )r1   r2   r3   r4   r   r(  r!   r]  rd  rf  rb  ra  rK   r?  rq  r  rt   r¤  r#  r,  r2  rc  rD  r  r›   rœ   s   @r    rM  rM     s™  ø€ € € € € ðJð JðX €TÔ˜E¨	Ð2Ñ2Ô2Ø-2Ø;=ð+$à#(¸4Øð+$ð +$ð +$ð +$ð +$ð +$ñ 3Ô2ð+$ðZ1ð 1ð 1ðð ð ð"ð ð ð
6ð 6ð 6ð2ð 2ð 2ð8 ð-ð -ñ „Xð-ðð ð ð(
.ð 
.ð 
.ð&ð &ð &ð0
ð 
ð 
ð$ð $ð $ðL!ð !ð !ð#ð #ð #ð$ð ð ð  ðð ñ „Xðð „\ðð ñ „\ðð ð ð ð r"   rM  c                   ó`   ‡ — e Zd ZdZ ej        dd¬¦  «        d	ˆ fd„	¦   «         Zd„ Zd„ Zˆ xZ	S )
ÚLassoaM  
    Selection curve of an arbitrary shape.

    The selected path can be used in conjunction with
    `~matplotlib.path.Path.contains_point` to select data points from an image.

    Unlike `LassoSelector`, this must be initialized with a starting
    point *xy*, and the `Lasso` events are destroyed upon release.

    Parameters
    ----------
    ax : `~matplotlib.axes.Axes`
        The parent Axes for the widget.
    xy : (float, float)
        Coordinates of the start of the lasso.
    callback : callable
        Whenever the lasso is released, the *callback* function is called and
        passed the vertices of the selected path.
    useblit : bool, default: True
        Whether to use blitting for faster drawing (if supported by the
        backend). See the tutorial :doc:`/tutorials/advanced/blitting`
        for details.
    rÎ   r^   rÏ   Tc                 óÜ  •— t          ¦   «                              |¦  «         |o| j        j        | _        | j        r)| j                             | j        j        ¦  «        | _        |\  }}||fg| _	        t          |g|gddd¬¦  «        | _        | j                             | j        ¦  «         || _        |                      d| j        ¦  «         |                      d| j        ¦  «         d S )NrT  rŒ  r  )rË  rz   rê   ri   rj   )rk   r!   rE   ro   r^   r©  rF   rŠ   r«  rD  r   rÓ  r  rS   rU   Ú	onreleaser¤  )r   rF   r  rS   r^   rŽ  rƒ  r}   s          €r    r!   zLasso.__init__€  sÝ   ø€ å‰Œ×Ò˜ÑÔÐàÐ< 4¤;Ô#<ˆŒØŒ<ð 	GØ"œk×8Ò8¸¼¼ÑFÔFˆDŒOà‰ˆˆ1Ø˜!�f�XˆŒ
Ý˜A˜3  ¨s¸'ÀaÐHÑHÔHˆŒ	ØŒ×Ò˜œÑ#Ô#Ð#Ø ˆŒØ×ÒÐ1°4´>ÑBÔBÐBØ×ÒÐ0°$´+Ñ>Ô>Ð>Ð>Ð>r"   c                 óZ  — |                       |¦  «        rd S | j        �q| j                             |j        |j        f¦  «         t          | j        ¦  «        dk    r|                      | j        ¦  «         | j                             ¦   «          d | _        |  	                    ¦   «          d S )Nr  )
rC   rD  rR   r  r  r”  rS   rÓ  r�  rY   rA   s     r    rˆ  zLasso.onrelease�  sœ   € Ø�;Š;�uÑÔð 	ØˆFØŒ:Ð!ØŒJ×Ò˜uœ{¨E¬KÐ8Ñ9Ô9Ð9Ý�4”:‰Œ Ò"Ð"Ø—’˜dœjÑ)Ô)Ð)ØŒI×ÒÑÔÐØˆŒ
Ø×ÒÑ Ô Ð Ð Ð r"   c                 ó>  — |                       |¦  «        rd S | j        €d S |j        | j        k    rd S |j        dk    rd S | j                             |j        |j        f¦  «         | j         	                    t          t          | j        Ž ¦  «        ¦  «         | j        rd| j                             | j        ¦  «         | j                             | j        ¦  «         | j                             | j        j        ¦  «         d S | j                             ¦   «          d S r   )rC   rD  r   rF   r  rR   r  r  rÓ  r¨  rK  r—  r^   rE   rÝ  r«  rˆ   r‰   rŠ   r!  rA   s     r    r¤  zLasso.onmove›  s  € Ø�;Š;�uÑÔð 	ØˆFØŒ:ÐØˆFØŒ<˜4œ7Ò"Ð"ØˆFØŒ<˜1ÒÐØˆFØŒ
×Ò˜5œ;¨¬Ð4Ñ5Ô5Ð5àŒ	×Ò�4¥ T¤ZÐ 0Ñ1Ô1Ñ2Ô2Ð2àŒ<ð 	$ØŒK×&Ò& t¤Ñ7Ô7Ð7ØŒG×Ò ¤	Ñ*Ô*Ð*ØŒK×Ò˜TœWœ\Ñ*Ô*Ð*Ð*Ð*àŒK×!Ò!Ñ#Ô#Ð#Ð#Ð#r"   )T)
r1   r2   r3   r4   r   r(  r!   rˆ  r¤  r›   rœ   s   @r    r†  r†  g  s„   ø€ € € € € ðð ð0 €TÔ˜E¨	Ð2Ñ2Ô2ð?ð ?ð ?ð ?ð ?ñ 3Ô2ð?ð	!ð 	!ð 	!ð$ð $ð $ð $ð $ð $ð $r"   r†  );r4   Ú
contextlibr   r  rs  Únumbersr   r   r   Únumpyr¿   Ú
matplotlibr  r  r   r	   r
   r   r   r   r   rq  r   r   rú  r   Úpatchesr   r   r   r   r   r   r   r7   rM   r[   rž   rÍ   r*  rw  ry  r  r\  r�  r¡  r´  r×  rV  rp  rÅ  Ú'_RECTANGLESELECTOR_PARAMETERS_DOCSTRINGÚSubstitutionr  rÝ  rA  rF  rM  r†  r5   r"   r    ú<module>r’     s  ðð	ð 	ð !Ð  Ð  Ð  Ð  Ð  Ø €€€Ø Ð Ð Ð Ø $Ð $Ð $Ð $Ð $Ð $Ð $Ð $à Ð Ð Ð Ð Ð Ø Ð Ð Ð à Ð Ð Ð ð2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2ð 2à Ð Ð Ð Ð Ð Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6ð#'ð #'ð #'ð #'ð #'ñ #'ô #'ð #'ðL)8ð )8ð )8ð )8ð )8ñ )8ô )8ð )8ðX(*ð (*ð (*ð (*ð (*�ñ (*ô (*ð (*ðVb(ð b(ð b(ð b(ð b(ˆZñ b(ô b(ð b(ðJK'ð K'ð K'ð K'ð K'�ñ K'ô K'ð K'ð\MIð MIð MIð MIð MIˆZñ MIô MIð MIð`|Ið |Ið |Ið |Ið |I�*ñ |Iô |Ið |Ið~@ð @ð @ð
Sð Sð Sð Sð S�:ñ Sô Sð Sðl
B(ð B(ð B(ð B(ð B(ˆjñ B(ô B(ð B(ðJMð Mð Mð Mð M�:ñ Mô Mð Mð`E&ð E&ð E&ð E&ð E&�&ñ E&ô E&ð E&ðPZð Zð Zð Zð ZˆZñ Zô Zð ZðzF#ð F#ð F#ð F#ð F#�&ñ F#ô F#ð F#ðRe"ð e"ð e"ð e"ð e"�jñ e"ô e"ð e"ðPpð pð pð pð p�?ñ pô pð pðfl"ð l"ð l"ð l"ð l"ñ l"ô l"ð l"ð^?*ð ?*ð ?*ð ?*ð ?*ñ ?*ô ?*ð ?*ðFTð (ðp €ÔÐ@×HÒHØ�{ñ$ô $ñ %ô %ðh?ð h?ð h?ð h?ð h?˜ñ h?ô h?ñ%ô %ðh?ðV €ÔÐ@×HÒHØ�yñ"ô "ñ #ô #ð%>ð %>ð %>ð %>ð %>Ð'ñ %>ô %>ñ#ô #ð%>ðPIð Ið Ið Ið I�Oñ Iô Ið IðXdð dð dð dð d�oñ dô dð dðNF$ð F$ð F$ð F$ð F$ˆJñ F$ô F$ð F$ð F$ð F$r"   