§
    õŽ’j§w  ã                   óö  — d Z ddlmZ ddlZddlmZ ddlmZ ddl	m
Z
 ddlmZ 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 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¦  «        Z G d$„ d%e¦  «        ZdS )&a  
Default legend handlers.

.. important::

    This is a low-level legend API, which most end users do not need.

    We recommend that you are familiar with the :ref:`legend guide
    <legend_guide>` before reading this documentation.

Legend handlers are expected to be a callable object with a following
signature::

    legend_handler(legend, orig_handle, fontsize, handlebox)

Where *legend* is the legend itself, *orig_handle* is the original
plot, *fontsize* is the fontsize in pixels, and *handlebox* is an
`.OffsetBox` instance. Within the call, you should create relevant
artists (using relevant properties from the *legend* and/or
*orig_handle*) and add them into the *handlebox*. The artists need to
be scaled according to the *fontsize* (note that the size is in pixels,
i.e., this is dpi-scaled value).

This module includes definition of several legend handler classes
derived from the base class (HandlerBase) with the following method::

    def legend_artist(self, legend, orig_handle, fontsize, handlebox)
é    )ÚcycleN)Úcbook©ÚLine2D)Ú	Rectanglec                 ó–   — t          t          |                     ¦   «         ¦  «        d ¦  «        }|�|                      |¦  «         d S d S ©N)ÚnextÚiterÚget_childrenÚupdate_from)ÚtgtÚsrcÚfirst_childs      úGC:\Projects\DSCons\.venv\Lib\site-packages\matplotlib\legend_handler.pyÚupdate_from_first_childr   (   sK   € Ý•t˜C×,Ò,Ñ.Ô.Ñ/Ô/°Ñ6Ô6€KØÐØ�Š˜Ñ$Ô$Ð$Ð$Ð$ð Ðó    c                   ó>   — e Zd ZdZdd„Zd„ Zd„ Zd„ Zd„ Zd	„ Z	d
„ Z
dS )ÚHandlerBasea  
    A base class for default legend handlers.

    The derived classes are meant to override *create_artists* method, which
    has the following signature::

      def create_artists(self, legend, orig_handle,
                         xdescent, ydescent, width, height, fontsize,
                         trans):

    The overridden method needs to create artists of the given
    transform that fits in the given dimension (xdescent, ydescent,
    width, height) that are scaled by fontsize if necessary.

    ç        Nc                 ó2   — ||c| _         | _        || _        dS )ak  
        Parameters
        ----------
        xpad : float, optional
            Padding in x-direction.
        ypad : float, optional
            Padding in y-direction.
        update_func : callable, optional
            Function for updating the legend handler properties from another
            legend handler, used by `~HandlerBase.update_prop`.
        N)Ú_xpadÚ_ypadÚ_update_prop_func)ÚselfÚxpadÚypadÚupdate_funcs       r   Ú__init__zHandlerBase.__init__>   s"   € ð "& tÐˆŒ
�D”JØ!,ˆÔÐÐr   c                 óp   — | j         €|                      ||¦  «         d S |                       ||¦  «         d S r	   )r   Ú_default_update_prop©r   Úlegend_handleÚorig_handles      r   Ú_update_propzHandlerBase._update_propM   sC   € ØÔ!Ð)Ø×%Ò% m°[ÑAÔAÐAÐAÐAà×"Ò" =°+Ñ>Ô>Ð>Ð>Ð>r   c                 ó0   — |                      |¦  «         d S r	   )r   r"   s      r   r!   z HandlerBase._default_update_propS   s   € Ø×!Ò! +Ñ.Ô.Ð.Ð.Ð.r   c                 ó°   — |                       ||¦  «         |                     |¦  «         |                     d ¦  «         |                     d ¦  «         d S r	   )r%   Ú_set_artist_propsÚset_clip_boxÚset_clip_path©r   r#   r$   Úlegends       r   Úupdate_propzHandlerBase.update_propV   sZ   € à×Ò˜-¨Ñ5Ô5Ð5à× Ò  Ñ/Ô/Ð/Ø×"Ò" 4Ñ(Ô(Ð(Ø×#Ò# DÑ)Ô)Ð)Ð)Ð)r   c                 óv   — || j         |z  z
  }|| j        |z  z
  }|| j         |z  z
  }|| j        |z  z
  }||||fS r	   )r   r   )r   r,   r$   ÚxdescentÚydescentÚwidthÚheightÚfontsizes           r   Úadjust_drawing_areazHandlerBase.adjust_drawing_area^   sW   € ð ˜dœj¨8Ñ3Ñ3ˆØ˜dœj¨8Ñ3Ñ3ˆØ˜œ
 XÑ-Ñ-ˆØ˜$œ* xÑ/Ñ/ˆØ˜ 5¨&Ð0Ð0r   c                 ó
  — |                       |||j        |j        |j        |j        |¦  «        \  }}}}|                      ||||||||                     ¦   «         ¦  «        }	|	D ]}
|                     |
¦  «         Œ|	d         S )a.  
        Return the artist that this HandlerBase generates for the given
        original artist/handle.

        Parameters
        ----------
        legend : `~matplotlib.legend.Legend`
            The legend for which these legend artists are being created.
        orig_handle : :class:`matplotlib.artist.Artist` or similar
            The object for which these legend artists are being created.
        fontsize : int
            The fontsize in pixels. The artists being created should
            be scaled according to the given fontsize.
        handlebox : `~matplotlib.offsetbox.OffsetBox`
            The box which has been created to hold this legend entry's
            artists. Artists created in the `legend_artist` method must
            be added to this handlebox inside this method.

        r   )r4   r/   r0   r1   r2   Úcreate_artistsÚget_transformÚ
add_artist)r   r,   r$   r3   Ú	handleboxr/   r0   r1   r2   ÚartistsÚas              r   Úlegend_artistzHandlerBase.legend_artistg   sª   € ð* -1×,DÒ,DØ˜ØÔ# YÔ%7Ø” )Ô"2Øñ	-ô -Ñ)ˆ�(˜E 6ð
 ×%Ò% f¨kØ&.°¸%ÀØ&.°	×0GÒ0GÑ0IÔ0IñKô Kˆð
 ð 	$ð 	$ˆAØ× Ò  Ñ#Ô#Ð#Ð#ð �qŒzÐr   c	                 ó    — t          d¦  «        ‚)a’  
        Return the legend artists generated.

        Parameters
        ----------
        legend : `~matplotlib.legend.Legend`
            The legend for which these legend artists are being created.
        orig_handle : `~matplotlib.artist.Artist` or similar
            The object for which these legend artists are being created.
        xdescent, ydescent, width, height : int
            The rectangle (*xdescent*, *ydescent*, *width*, *height*) that the
            legend artists being created should fit within.
        fontsize : int
            The fontsize in pixels. The legend artists being created should
            be scaled according to the given fontsize.
        trans : `~matplotlib.transforms.Transform`
            The transform that is applied to the legend artists being created.
            Typically from unit coordinates in the handler box to screen
            coordinates.
        zDerived must override)ÚNotImplementedError)	r   r,   r$   r/   r0   r1   r2   r3   Útranss	            r   r6   zHandlerBase.create_artistsŒ   s   € õ. "Ð"9Ñ:Ô:Ð:r   )r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r%   r!   r-   r4   r<   r6   © r   r   r   r   .   s�   € € € € € ðð ð-ð -ð -ð -ð?ð ?ð ?ð/ð /ð /ð*ð *ð *ð1ð 1ð 1ð#ð #ð #ðJ;ð ;ð ;ð ;ð ;r   r   c                   ó0   ‡ — e Zd ZdZdˆ fd„	Zd„ Zd„ Zˆ xZS )ÚHandlerNpointszM
    A legend handler that shows *numpoints* points in the legend entry.
    ç333333Ó?Nc                 óV   •—  t          ¦   «         j        di |¤Ž || _        || _        dS )a  
        Parameters
        ----------
        marker_pad : float
            Padding between points in legend entry.
        numpoints : int
            Number of points to show in legend entry.
        **kwargs
            Keyword arguments forwarded to `.HandlerBase`.
        NrD   )Úsuperr   Ú
_numpointsÚ_marker_pad)r   Ú
marker_padÚ	numpointsÚkwargsÚ	__class__s       €r   r   zHandlerNpoints.__init__«   s7   ø€ ð 	�‰ŒÔÐ"Ð"˜6Ð"Ð"Ð"à#ˆŒØ%ˆÔÐÐr   c                 ó,   — | j         €|j        S | j         S r	   )rJ   rM   ©r   r,   s     r   Úget_numpointszHandlerNpoints.get_numpoints»   s   € ØŒ?Ð"ØÔ#Ð#à”?Ð"r   c                 óÂ   — |                       |¦  «        }|dk    r.| j        |z  }t          j        | |z   | |z   |z
  |¦  «        }	|	}
n| | |z   g}	| d|z  z   g}
|	|
fS )Né   ç      à?)rR   rK   ÚnpÚlinspace)r   r,   r/   r0   r1   r2   r3   rM   ÚpadÚxdataÚxdata_markers              r   Ú	get_xdatazHandlerNpoints.get_xdataÁ   s�   € Ø×&Ò& vÑ.Ô.ˆ	Ø�qŠ=ˆ=àÔ" XÑ-ˆCÝ”K  	¨C¡Ø!) 	¨EÑ 1°CÑ 7Ø )ñ+ô +ˆEð !ˆLˆLà�Y  	¨EÑ 1Ð2ˆEØ%˜I¨¨e©Ñ3Ð4ˆLØ�lÐ"Ð"r   )rG   N)r@   rA   rB   rC   r   rR   r[   Ú__classcell__©rO   s   @r   rF   rF   ¦   se   ø€ € € € € ðð ð&ð &ð &ð &ð &ð &ð #ð #ð #ð#ð #ð #ð #ð #ð #ð #r   rF   c                   ó*   ‡ — e Zd ZdZdˆ fd„	Zd„ Zˆ xZS )ÚHandlerNpointsYoffsetsz‚
    A legend handler that shows *numpoints* in the legend, and allows them to
    be individually offset in the y-direction.
    Nc                 óL   •—  t          ¦   «         j        dd|i|¤Ž || _        dS )aL  
        Parameters
        ----------
        numpoints : int
            Number of points to show in legend entry.
        yoffsets : array of floats
            Length *numpoints* list of y offsets for each point in
            legend entry.
        **kwargs
            Keyword arguments forwarded to `.HandlerNpoints`.
        rM   NrD   )rI   r   Ú	_yoffsets)r   rM   ÚyoffsetsrN   rO   s       €r   r   zHandlerNpointsYoffsets.__init__Ö   s2   ø€ ð 	�‰ŒÔÐ7Ð7 9Ð7°Ð7Ð7Ð7Ø!ˆŒˆˆr   c                 ób   — | j         €||j        z  }n|t          j        | j         ¦  «        z  }|S r	   ©ra   Ú_scatteryoffsetsrV   Úasarray©r   r,   r/   r0   r1   r2   r3   Úydatas           r   Ú	get_ydataz HandlerNpointsYoffsets.get_ydataå   s4   € ØŒ>Ð!Ø˜VÔ4Ñ4ˆEˆEà�RœZ¨¬Ñ7Ô7Ñ7ˆEàˆr   ©NN)r@   rA   rB   rC   r   ri   r\   r]   s   @r   r_   r_   Ð   sV   ø€ € € € € ðð ð
"ð "ð "ð "ð "ð "ðð ð ð ð ð ð r   r_   c                   ó   — e Zd ZdZd„ ZdS )ÚHandlerLine2DCompoundz™
    Original handler for `.Line2D` instances, that relies on combining
    a line-only with a marker-only artist.  May be deprecated in the future.
    c	                 ó˜  — |                       ||||||¦  «        \  }	}
t          j        |	||z
  dz  ¦  «        }t          |	|¦  «        }|                      |||¦  «         |                     d¦  «         |                     d¦  «         t          |
|d t          |
¦  «        …         ¦  «        }|                      |||¦  «         |                     d¦  «         |j	        dk    r1| 
                    ¦   «         |j	        z  }|                     |¦  «         ||_        |                     |¦  «         |                     |¦  «         ||gS )Né   ÚdefaultÚ ÚNonerT   )r[   rV   Ú	full_liker   r-   Úset_drawstyleÚ
set_markerÚlenÚset_linestyleÚmarkerscaleÚget_markersizeÚset_markersizeÚ
_legmarkerÚset_transform)r   r,   r$   r/   r0   r1   r2   r3   r?   rY   rZ   rh   ÚleglineÚlegline_markerÚnewszs                  r   r6   z$HandlerLine2DCompound.create_artistsô   s]  € ð #Ÿnšn¨V°X¸xØ-2°F¸HñFô FÑˆˆ|õ ”˜U f¨xÑ&7¸1Ñ%<Ñ>Ô>ˆÝ˜ Ñ&Ô&ˆà×Ò˜ +¨vÑ6Ô6Ð6Ø×Ò˜iÑ(Ô(Ð(Ø×Ò˜2ÑÔÐå ¨eÐ4FµS¸Ñ5FÔ5FÐ4FÔ.GÑHÔHˆØ×Ò˜¨°fÑ=Ô=Ð=Ø×$Ò$ VÑ,Ô,Ð,ØÔ Ò"Ð"Ø"×1Ò1Ñ3Ô3°fÔ6HÑHˆEØ×)Ò)¨%Ñ0Ô0Ð0ð ,ˆÔà×Ò˜eÑ$Ô$Ð$Ø×$Ò$ UÑ+Ô+Ð+à˜Ð(Ð(r   N©r@   rA   rB   rC   r6   rD   r   r   rl   rl   î   s-   € € € € € ðð ð
)ð )ð )ð )ð )r   rl   c                   ó   — e Zd ZdZd„ ZdS )ÚHandlerLine2Dzâ
    Handler for `.Line2D` instances.

    See Also
    --------
    HandlerLine2DCompound : An earlier handler implementation, which used one
                            artist for the line and another for the marker(s).
    c	                 óì  — |                       ||||||¦  «        \  }	}
d }|                      |¦  «        dk    r%t          j        |	d         |	d         d¦  «        }	dg}t          j        |	||z
  dz  ¦  «        }t          |	||¬¦  «        }|                      |||¦  «         |j        dk    r1|                     ¦   «         |j        z  }| 	                    |¦  «         | 
                    |¦  «         |gS )NrT   r   éÿÿÿÿé   rn   )Ú	markevery)r[   rR   rV   rW   rr   r   r-   rw   rx   ry   r{   )r   r,   r$   r/   r0   r1   r2   r3   r?   rY   rZ   r…   rh   r|   r~   s                  r   r6   zHandlerLine2D.create_artists  s  € ð #Ÿnšn¨V°X¸xØ-2°F¸HñFô FÑˆˆ|ð ˆ	Ø×Ò˜fÑ%Ô%¨Ò*Ð*õ ”K  a¤¨%°¬)°QÑ7Ô7ˆEØ˜ˆIå”˜U V¨hÑ%6¸!Ñ$;Ñ<Ô<ˆÝ˜ °Ð;Ñ;Ô;ˆà×Ò˜ +¨vÑ6Ô6Ð6àÔ Ò"Ð"Ø×*Ò*Ñ,Ô,¨vÔ/AÑAˆEØ×"Ò" 5Ñ)Ô)Ð)à×Ò˜eÑ$Ô$Ð$àˆyÐr   Nr   rD   r   r   r�   r�     s-   € € € € € ðð ðð ð ð ð r   r�   c                   ó0   ‡ — e Zd ZdZdˆ fd„	Zd„ Zd„ Zˆ xZS )ÚHandlerPatchz)
    Handler for `.Patch` instances.
    Nc                 óH   •—  t          ¦   «         j        di |¤Ž || _        dS )a†  
        Parameters
        ----------
        patch_func : callable, optional
            The function that creates the legend key artist.
            *patch_func* should have the signature::

                def patch_func(legend=legend, orig_handle=orig_handle,
                               xdescent=xdescent, ydescent=ydescent,
                               width=width, height=height, fontsize=fontsize)

            Subsequently, the created artist will have its ``update_prop``
            method called and the appropriate transform will be applied.

        **kwargs
            Keyword arguments forwarded to `.HandlerBase`.
        NrD   )rI   r   Ú_patch_func)r   Ú
patch_funcrN   rO   s      €r   r   zHandlerPatch.__init__?  s0   ø€ ð$ 	�‰ŒÔÐ"Ð"˜6Ð"Ð"Ð"Ø%ˆÔÐÐr   c           	      óz   — | j         €t          | | f||¬¦  «        }n|                       |||||||¬¦  «        }|S )N©Úxyr1   r2   )r,   r$   r/   r0   r1   r2   r3   )r‰   r   )	r   r,   r$   r/   r0   r1   r2   r3   Úps	            r   Ú_create_patchzHandlerPatch._create_patchT  sf   € àÔÐ#Ý˜x˜i¨(¨Ð3Ø %¨fð6ñ 6ô 6ˆAˆAð × Ò ¨¸KØ*2¸XØ',°VÀhð !ñ Pô PˆAð ˆr   c	           	      ó–   — |                       |||||||¦  «        }	|                      |	||¦  «         |	                     |¦  «         |	gS r	   )r�   r-   r{   ©
r   r,   r$   r/   r0   r1   r2   r3   r?   rŽ   s
             r   r6   zHandlerPatch.create_artists_  s[   € ð ×Ò˜v {Ø'¨°5¸&À(ñLô Lˆà×Ò˜˜K¨Ñ0Ô0Ð0Ø	�Š˜ÑÔÐØˆsˆ
r   r	   )r@   rA   rB   rC   r   r�   r6   r\   r]   s   @r   r‡   r‡   :  se   ø€ € € € € ðð ð&ð &ð &ð &ð &ð &ð*	ð 	ð 	ðð ð ð ð ð ð r   r‡   c                   óD   — e Zd ZdZed„ ¦   «         Zed„ ¦   «         Zd„ ZdS )ÚHandlerStepPatchzA
    Handler for `~.matplotlib.patches.StepPatch` instances.
    c                 óT   — t          | | f|||                      ¦   «         ¬¦  «        S )N)r�   r1   r2   Úcolor)r   Úget_facecolor)r$   r/   r0   r1   r2   s        r   r�   zHandlerStepPatch._create_patchn  s;   € å˜h˜Y¨¨	Ð2¸%Ø &¨k×.GÒ.GÑ.IÔ.IðKñ Kô Kð 	Kr   c                 ó  — t          d|g|dz  |dz  g|                      ¦   «         |                      ¦   «         |                      ¦   «         ¬¦  «        }|                     d¦  «         |                     d¦  «         |S )Nr   rn   )r•   Ú	linestyleÚ	linewidthro   rp   )r   Úget_edgecolorÚget_linestyleÚget_linewidthrs   rt   )r$   r1   r2   r|   s       r   Ú_create_linezHandlerStepPatch._create_lines  s‰   € õ ˜!˜U˜ f¨Q¡h°°q±Ð%9Ø*×8Ò8Ñ:Ô:Ø#.×#<Ò#<Ñ#>Ô#>Ø#.×#<Ò#<Ñ#>Ô#>ðñ ô ˆð 	×Ò˜iÑ(Ô(Ð(Ø×Ò˜2ÑÔÐØˆr   c	                 ó  — |                      ¦   «         s|                     ¦   «         �1|                      |||||¦  «        }	|                      |	||¦  «         n|                      |||¦  «        }	|	                     |¦  «         |	gS r	   )Úget_fillÚ	get_hatchr�   r-   r�   r{   r‘   s
             r   r6   zHandlerStepPatch.create_artists�  s”   € ð ×ÒÑ!Ô!ð 	> k×&;Ò&;Ñ&=Ô&=Ð&IØ×"Ò" ;°¸(ÀEØ#)ñ+ô +ˆAà×Ò˜Q ¨VÑ4Ô4Ð4Ð4à×!Ò! +¨u°fÑ=Ô=ˆAØ	�Š˜ÑÔÐØˆsˆ
r   N)r@   rA   rB   rC   Ústaticmethodr�   r�   r6   rD   r   r   r“   r“   i  sf   € € € € € ðð ð ðKð Kñ „\ðKð ðð ñ „\ðð
ð 
ð 
ð 
ð 
r   r“   c                   ó$   — e Zd ZdZd„ Zd„ Zd„ ZdS )ÚHandlerLineCollectionz2
    Handler for `.LineCollection` instances.
    c                 ó,   — | j         €|j        S | j         S r	   ©rJ   ÚscatterpointsrQ   s     r   rR   z#HandlerLineCollection.get_numpoints’  ó   € ØŒ?Ð"ØÔ'Ð'à”?Ð"r   c                 ó  — |                      ¦   «         d         }|j        d         }|                     ¦   «         d         }|                     |¦  «         |                     |¦  «         |                     |¦  «         d S ©Nr   )Úget_linewidthsÚ_us_linestylesÚ
get_colorsÚ	set_colorrv   Úset_linewidth)r   r#   r$   ÚlwÚdashesr•   s         r   r!   z*HandlerLineCollection._default_update_prop˜  s}   € Ø×'Ò'Ñ)Ô)¨!Ô,ˆØÔ+¨AÔ.ˆØ×&Ò&Ñ(Ô(¨Ô+ˆØ×Ò Ñ&Ô&Ð&Ø×#Ò# FÑ+Ô+Ð+Ø×#Ò# BÑ'Ô'Ð'Ð'Ð'r   c	                 óð   — |                       ||||||¦  «        \  }	}
t          j        |	||z
  dz  ¦  «        }t          |	|¦  «        }|                      |||¦  «         |                     |¦  «         |gS )Nrn   )r[   rV   rr   r   r-   r{   )r   r,   r$   r/   r0   r1   r2   r3   r?   rY   rZ   rh   r|   s                r   r6   z$HandlerLineCollection.create_artists   s‰   € ð #Ÿnšn¨V°X¸xØ-2°F¸HñFô FÑˆˆ|å”˜U V¨hÑ%6¸!Ñ$;Ñ<Ô<ˆÝ˜ Ñ&Ô&ˆà×Ò˜ +¨vÑ6Ô6Ð6Ø×Ò˜eÑ$Ô$Ð$àˆyÐr   N)r@   rA   rB   rC   rR   r!   r6   rD   r   r   r£   r£   Ž  sK   € € € € € ðð ð#ð #ð #ð(ð (ð (ðð ð ð ð r   r£   c                   óB   ‡ — e Zd ZdZd	ˆ fd„	Zd„ Zd„ Zd„ Zd„ Zd„ Z	ˆ xZ
S )
ÚHandlerRegularPolyCollectionz'Handler for `.RegularPolyCollection`\s.Nc                 óL   •—  t          ¦   «         j        dd|i|¤Ž || _        d S )Nrb   rD   )rI   r   Ú_sizes)r   rb   ÚsizesrN   rO   s       €r   r   z%HandlerRegularPolyCollection.__init__±  s0   ø€ Ø�‰ŒÔÐ5Ð5 (Ð5¨fÐ5Ð5Ð5àˆŒˆˆr   c                 ó,   — | j         €|j        S | j         S r	   r¥   rQ   s     r   rR   z*HandlerRegularPolyCollection.get_numpoints¶  r§   r   c                 óx  — | j         €«|                     ¦   «         }t          |¦  «        sdg}t          |¦  «        |j        dz  z  }	t          |¦  «        |j        dz  z  }
|                      |¦  «        }|dk     rd|	|
z   z  |	|
gd |…         }n)|	|
z
  }|t          j        dd|¦  «        z  |
z   }n| j         }|S )NrT   rn   é   rU   r   )	rµ   Ú	get_sizesru   Úmaxrw   ÚminrR   rV   rW   )r   r,   r$   r/   r0   r1   r2   r3   Úhandle_sizesÚsize_maxÚsize_minrM   r¶   Úrngs                 r   rº   z&HandlerRegularPolyCollection.get_sizes¼  sà   € àŒ;ÐØ&×0Ò0Ñ2Ô2ˆLÝ�|Ñ$Ô$ð #Ø !˜s�Ý˜<Ñ(Ô(¨6Ô+=ÀÑ+BÑBˆHÝ˜<Ñ(Ô(¨6Ô+=ÀÑ+BÑBˆHà×*Ò*¨6Ñ2Ô2ˆIØ˜1Š}ˆ}Ø˜x¨(Ñ2Ñ3°XØ!ð#Ø#- I :ô/��ð   (Ñ*�Ø�bœk¨!¨Q°	Ñ:Ô:Ñ:¸XÑE��à”KˆEàˆr   c                 óØ   — |                       ||¦  «         |                     |                     d¬¦  «        ¦  «         |                     d ¦  «         |                     d ¦  «         d S )NF)Úroot)r%   Ú
set_figureÚ
get_figurer)   r*   r+   s       r   r-   z(HandlerRegularPolyCollection.update_propÑ  sk   € à×Ò˜-¨Ñ5Ô5Ð5à× Ò  ×!2Ò!2¸Ð!2Ñ!>Ô!>Ñ?Ô?Ð?à×"Ò" 4Ñ(Ô(Ð(Ø×#Ò# DÑ)Ô)Ð)Ð)Ð)r   c                 ó„   —  t          |¦  «        |                     ¦   «         |                     ¦   «         |||¬¦  «        S )N)Úrotationr¶   ÚoffsetsÚoffset_transform)ÚtypeÚget_numsidesÚget_rotation©r   r$   r¶   rÇ   rÈ   s        r   Úcreate_collectionz.HandlerRegularPolyCollection.create_collectionÚ  sI   € Ø �t�KÑ Ô Ø×$Ò$Ñ&Ô&Ø ×-Ò-Ñ/Ô/°uØÐ.>ð
ñ 
ô 
ð 	
r   c	           
      ól  — |                       ||||||¦  «        \  }	}
|                      ||||||¦  «        }|                      |||||||¦  «        }|                      ||t	          t          |
|¦  «        ¦  «        |¬¦  «        }|                      |||¦  «         |                     |¦  «         |gS ©N)rÇ   rÈ   )r[   ri   rº   rÍ   ÚlistÚzipr-   Úset_offset_transform)r   r,   r$   r/   r0   r1   r2   r3   r?   rY   rZ   rh   r¶   rŽ   s                 r   r6   z+HandlerRegularPolyCollection.create_artistsá  sà   € ð #Ÿnšn¨V°X¸xØ-2°F¸HñFô FÑˆˆ|ð —’˜v x°Ø$ f¨hñ8ô 8ˆð —’˜v {°H¸hØ$ f¨hñ8ô 8ˆð ×"Ò"Ø˜Ý�˜\¨5Ñ1Ô1Ñ2Ô2ÀUð #ñ Lô Lˆð 	×Ò˜˜K¨Ñ0Ô0Ð0Ø	×Ò˜uÑ%Ô%Ð%Øˆsˆ
r   rj   )r@   rA   rB   rC   r   rR   rº   r-   rÍ   r6   r\   r]   s   @r   r³   r³   ®  sŽ   ø€ € € € € Ø2Ð2ðð ð ð ð ð ð
#ð #ð #ðð ð ð**ð *ð *ð
ð 
ð 
ðð ð ð ð ð ð r   r³   c                   ó   — e Zd ZdZd„ ZdS )ÚHandlerPathCollectionzDHandler for `.PathCollection`\s, which are used by `~.Axes.scatter`.c                 ól   —  t          |¦  «        |                     ¦   «         d         g|||¬¦  «        S )Nr   )r¶   rÇ   rÈ   )rÉ   Ú	get_pathsrÌ   s        r   rÍ   z'HandlerPathCollection.create_collectionú  sB   € Ø �t�KÑ Ô Ø×"Ò"Ñ$Ô$ QÔ'Ð(°ØÐ.>ð
ñ 
ô 
ð 	
r   N©r@   rA   rB   rC   rÍ   rD   r   r   rÔ   rÔ   ÷  s)   € € € € € ØOÐOð
ð 
ð 
ð 
ð 
r   rÔ   c                   ó   — e Zd ZdZd„ ZdS )ÚHandlerCircleCollectionz"Handler for `.CircleCollection`\s.c                 ó8   —  t          |¦  «        |||¬¦  «        S rÏ   )rÉ   rÌ   s        r   rÍ   z)HandlerCircleCollection.create_collection  s/   € Ø �t�KÑ Ô Ø˜7Ð5EðGñ Gô Gð 	Gr   Nr×   rD   r   r   rÙ   rÙ     s.   € € € € € Ø-Ð-ðGð Gð Gð Gð Gr   rÙ   c                   ó4   ‡ — e Zd ZdZ	 	 dˆ fd„	Zd„ Zd„ Zˆ xZS )	ÚHandlerErrorbarzHandler for Errorbars.rU   NrG   c                 ó\   •— || _         || _         t          ¦   «         j        d||dœ|¤Ž d S )N)rL   rM   rD   )Ú
_xerr_sizeÚ
_yerr_sizerI   r   )r   Ú	xerr_sizeÚ	yerr_sizerL   rM   rN   rO   s         €r   r   zHandlerErrorbar.__init__  s=   ø€ ð $ˆŒØ#ˆŒà�‰ŒÔÐN J¸)ÐNÐNÀvÐNÐNÐNÐNÐNr   c                 óF   — | j         |z  }| j        €|}n
| j        |z  }||fS r	   )rÞ   rß   )	r   r,   r/   r0   r1   r2   r3   rà   rá   s	            r   Úget_err_sizezHandlerErrorbar.get_err_size  s4   € à”O hÑ.ˆ	àŒ?Ð"Ø!ˆIˆIàœ¨(Ñ2ˆIà˜)Ð#Ð#r   c	                 óö  ‡‡— |\  }	}
}|                       ||||||¦  «        \  }}t          j        |||z
  dz  ¦  «        }t          ||¦  «        }t          j        |¦  «        }t          j        |d t          |¦  «        …         ¦  «        }|                      ||||||¦  «        \  ŠŠt          ||¦  «        }|	€+|                     d¦  «         |                     d¦  «         n©|                      ||	|¦  «         | 	                    d¦  «         | 
                    d¦  «         |                      ||	|¦  «         |                     d¦  «         |j        dk    r1|                     ¦   «         |j        z  }|                     |¦  «         g }g }|j        �rˆfd„t!          ||¦  «        D ¦   «         }t#          j        |¦  «        }|                      ||d         |¦  «         |                     |¦  «         |
r´t          |‰z
  |¦  «        }t          |‰z   |¦  «        }|                      ||
d         |¦  «         |                      ||
d         |¦  «         | 
                    d	¦  «         | 
                    d	¦  «         |                     |¦  «         |                     |¦  «         |j        �rˆfd
„t!          ||¦  «        D ¦   «         }t#          j        |¦  «        }|                      ||d         |¦  «         |                     |¦  «         |
r´t          ||‰z
  ¦  «        }t          ||‰z   ¦  «        }|                      ||
d         |¦  «         |                      ||
d         |¦  «         | 
                    d¦  «         | 
                    d¦  «         |                     |¦  «         |                     |¦  «         g |¢|¢|‘|‘}|D ]}|                     |¦  «         Œ|S )Nrn   Fro   Únonerq   rT   c                 ó2   •— g | ]\  }}|‰z
  |f|‰z   |ff‘ŒS rD   rD   )Ú.0ÚxÚyrà   s      €r   ú
<listcomp>z2HandlerErrorbar.create_artists.<locals>.<listcomp>I  sJ   ø€ ð Bð Bð BÙ˜˜Að ˜9‘} aÐ(¨1¨y©=¸!Ð*<Ð=ð Bð Bð Br   r   ú|c                 ó2   •— g | ]\  }}||‰z
  f||‰z   ff‘ŒS rD   rD   )rç   rè   ré   rá   s      €r   rê   z2HandlerErrorbar.create_artists.<locals>.<listcomp>[  sJ   ø€ ð Bð Bð BÙ˜˜Að ˜!˜i™-Ð(¨1¨a°)©mÐ*<Ð=ð Bð Bð Br   Ú_)r[   rV   rr   r   rf   ru   rã   Úset_visibler-   rs   rt   rv   rw   rx   ry   Úhas_xerrrÑ   ÚmcollÚLineCollectionÚappendÚhas_yerrr{   )r   r,   r$   r/   r0   r1   r2   r3   r?   Ú	plotlinesÚcaplinesÚbarlinecolsrY   rZ   rh   r|   Úydata_markerr}   r~   Úhandle_barlinecolsÚhandle_caplinesÚvertsÚcollÚcapline_leftÚcapline_rightr:   Úartistrà   rá   s                              @@r   r6   zHandlerErrorbar.create_artists  s�  øø€ ð ,7Ñ(ˆ	�8˜[à"Ÿnšn¨V°X¸xØ-2°F¸HñFô FÑˆˆ|õ ”˜U V¨hÑ%6¸!Ñ$;Ñ<Ô<ˆÝ˜ Ñ&Ô&ˆå”z ,Ñ/Ô/ˆÝ”z %Ð(:­¨\Ñ):Ô):Ð(:Ô";Ñ<Ô<ˆà#×0Ò0°¸À8Ø16¸Àñ Jô  JÑˆ	�9õ   ¨lÑ;Ô;ˆð ÐØ×Ò Ñ&Ô&Ð&Ø×&Ò& uÑ-Ô-Ð-Ð-à×Ò˜W i°Ñ8Ô8Ð8à×!Ò! )Ñ,Ô,Ð,Ø×Ò˜vÑ&Ô&Ð&à×Ò˜^¨Y¸Ñ?Ô?Ð?Ø×(Ò(¨Ñ0Ô0Ð0àÔ! QÒ&Ð&Ø&×5Ò5Ñ7Ô7¸&Ô:LÑL�Ø×-Ò-¨eÑ4Ô4Ð4àÐØˆàÔñ 	6ðBð Bð Bð BÝ!$ \°<Ñ!@Ô!@ðBñ Bô BˆEåÔ'¨Ñ.Ô.ˆDØ×Ò˜T ;¨q¤>°6Ñ:Ô:Ð:Ø×%Ò% dÑ+Ô+Ð+àð 	6Ý% l°YÑ&>ÀÑMÔM�Ý & |°iÑ'?ÀÑ NÔ N�Ø× Ò  ¨x¸¬{¸FÑCÔCÐCØ× Ò  °¸´¸VÑDÔDÐDØ×'Ò'¨Ñ,Ô,Ð,Ø×(Ò(¨Ñ-Ô-Ð-à×&Ò& |Ñ4Ô4Ð4Ø×&Ò& }Ñ5Ô5Ð5àÔñ 	6ðBð Bð Bð BÝ!$ \°<Ñ!@Ô!@ðBñ Bô BˆEåÔ'¨Ñ.Ô.ˆDØ×Ò˜T ;¨q¤>°6Ñ:Ô:Ð:Ø×%Ò% dÑ+Ô+Ð+àð 	6Ý% l°LÀ9Ñ4LÑMÔM�Ý & |°\ÀIÑ5MÑ NÔ N�Ø× Ò  ¨x¸¬{¸FÑCÔCÐCØ× Ò  °¸´¸VÑDÔDÐDØ×'Ò'¨Ñ,Ô,Ð,Ø×(Ò(¨Ñ-Ô-Ð-à×&Ò& |Ñ4Ô4Ð4Ø×&Ò& }Ñ5Ô5Ð5ð
Øð
Ø"1ð
Ø3:ð
Ø<Jð
ˆð ð 	(ð 	(ˆFØ× Ò  Ñ'Ô'Ð'Ð'Øˆr   )rU   NrG   N)r@   rA   rB   rC   r   rã   r6   r\   r]   s   @r   rÜ   rÜ   	  st   ø€ € € € € Ø Ð à04Ø+/ðOð Oð Oð Oð Oð Oð	$ð 	$ð 	$ðRð Rð Rð Rð Rð Rð Rr   rÜ   c                   ó:   ‡ — e Zd ZdZ	 	 dˆ fd„	Zd„ Zd„ Zd„ Zˆ xZS )	ÚHandlerStemz6
    Handler for plots produced by `~.Axes.stem`.
    rG   Nc                 óP   •—  t          ¦   «         j        d|||dœ|¤Ž || _        dS )aç  
        Parameters
        ----------
        marker_pad : float, default: 0.3
            Padding between points in legend entry.
        numpoints : int, optional
            Number of points to show in legend entry.
        bottom : float, optional

        yoffsets : array of floats, optional
            Length *numpoints* list of y offsets for each point in
            legend entry.
        **kwargs
            Keyword arguments forwarded to `.HandlerNpointsYoffsets`.
        )rL   rM   rb   NrD   )rI   r   Ú_bottom)r   rL   rM   Úbottomrb   rN   rO   s         €r   r   zHandlerStem.__init__y  sD   ø€ ð" 	�‰ŒÔð 	6 J¸)Ø"*ð	6ð 	6Ø.4ð	6ð 	6ð 	6àˆŒˆˆr   c                 ón   — | j         €|d|j        z  dz   z  }n|t          j        | j         ¦  «        z  }|S )NrU   rd   rg   s           r   ri   zHandlerStem.get_ydataŽ  s>   € ØŒ>Ð!Ø˜c FÔ$;Ñ;¸cÑAÑBˆEˆEà�RœZ¨¬Ñ7Ô7Ñ7ˆEàˆr   c	                 ój  ‡— |\  }	}
}t          |
t          j        ¦  «        }|                      ||||||¦  «        \  }}|                      ||||||¦  «        }| j        €dŠn| j        Št          ||d t          |¦  «        …         ¦  «        }|                      ||	|¦  «         ˆfd„t          ||¦  «        D ¦   «         }|rQt          j        | | j        ¬¦  «        5  |D ]}|                      ||
|¦  «         Œ	 d d d ¦  «         n# 1 swxY w Y   n-t          ||
¦  «        D ]\  }}|                      |||¦  «         Œt          t          j        |¦  «        t          j        |¦  «        g‰‰g¦  «        }|                      |||¦  «         g |¢|‘|‘}|D ]}|                     |¦  «         Œ|S )Nr   c                 ó>   •— g | ]\  }}t          ||g‰|g¦  «        ‘ŒS rD   r   )rç   rè   ré   r  s      €r   rê   z.HandlerStem.create_artists.<locals>.<listcomp>®  s?   ø€ ð ?ð ?ð ?Ù!˜Q õ    A ¨°¨Ñ4Ô4ð ?ð ?ð ?r   )r   )Ú
isinstancerð   rñ   r[   ri   r  r   ru   r-   rÑ   r   Ú_setattr_cmÚ_copy_collection_propsrV   r¼   r»   r{   )r   r,   r$   r/   r0   r1   r2   r3   r?   Ú
markerlineÚ	stemlinesÚbaselineÚusing_linecollrY   rZ   rh   Úleg_markerlineÚleg_stemlinesÚlineÚlmÚmÚleg_baseliner:   rþ   r  s                           @r   r6   zHandlerStem.create_artists–  se  ø€ ð +6Ñ'ˆ
�I˜xõ $ I­uÔ/CÑDÔDˆà"Ÿnšn¨V°X¸xØ-2°F¸HñFô FÑˆˆ|ð —’˜v x°Ø$ f¨hñ8ô 8ˆð Œ<ÐØˆFˆFà”\ˆFå ¨eÐ4FµS¸Ñ5FÔ5FÐ4FÔ.GÑHÔHˆØ×Ò˜¨°VÑ<Ô<Ð<ð?ð ?ð ?ð ?Ý%(¨°uÑ%=Ô%=ð?ñ ?ô ?ˆð ð 
	0õ Ô"Ø¨DÔ,GðIñ Iô Ið >ð >à)ð >ð >�DØ×$Ò$ T¨9°fÑ=Ô=Ð=Ð=ð>ð>ð >ð >ñ >ô >ð >ð >ð >ð >ð >ð >øøøð >ð >ð >ð >øõ ˜]¨IÑ6Ô6ð 0ð 0‘��AØ× Ò   Q¨Ñ/Ô/Ð/Ð/å�rœv e™}œ}­b¬f°U©m¬mÐ<Ø% vÐ.ñ0ô 0ˆà×Ò˜ x°Ñ8Ô8Ð8à@�MÐ@ <Ð@°Ð@ˆØð 	(ð 	(ˆFØ× Ò  Ñ'Ô'Ð'Ð'Øˆs   ÃD	Ä	DÄDc                 óº   — |                      |                     ¦   «         d         ¦  «         |                     |                     ¦   «         d         ¦  «         dS )zt
        Copy properties from the `.LineCollection` *orig_handle* to the
        `.Line2D` *legend_handle*.
        r   N)r­   Ú	get_colorrv   r›   r"   s      r   r	  z"HandlerStem._copy_collection_propsÆ  sT   € ð
 	×Ò × 5Ò 5Ñ 7Ô 7¸Ô :Ñ;Ô;Ð;Ø×#Ò# K×$=Ò$=Ñ$?Ô$?ÀÔ$BÑCÔCÐCÐCÐCr   )rG   NNN)	r@   rA   rB   rC   r   ri   r6   r	  r\   r]   s   @r   r   r   t  s„   ø€ € € € € ðð ð 26Ø'+ðð ð ð ð ð ð*ð ð ð.ð .ð .ð`Dð Dð Dð Dð Dð Dð Dr   r   c                   ó*   ‡ — e Zd ZdZdˆ fd„	Zd„ Zˆ xZS )ÚHandlerTuplez
    Handler for Tuple.
    rT   Nc                 óV   •— || _         || _         t          ¦   «         j        di |¤Ž dS )a�  
        Parameters
        ----------
        ndivide : int or None, default: 1
            The number of sections to divide the legend area into.  If None,
            use the length of the input tuple.
        pad : float, default: :rc:`legend.borderpad`
            Padding in units of fraction of font size.
        **kwargs
            Keyword arguments forwarded to `.HandlerBase`.
        NrD   )Ú_ndivideÚ_padrI   r   )r   ÚndividerX   rN   rO   s       €r   r   zHandlerTuple.__init__Ô  s6   ø€ ð  ˆŒØˆŒ	Ø�‰ŒÔÐ"Ð"˜6Ð"Ð"Ð"Ð"Ð"r   c	                 óÔ  — |                      ¦   «         }	| j        €t          |¦  «        }
n| j        }
| j        €|j        |z  }n
| j        |z  }|
dk    r|||
dz
  z  z
  |
z  }t          |||z   t          j        |
¦  «        z  z
  ¦  «        }g }|D ]V}|                     |	|¦  «        }| 	                    ||t          |¦  «        |||||¦  «        }|                     |¦  «         ŒW|S )NrT   )Úget_legend_handler_mapr  ru   r  Ú	borderpadr   rV   ÚarangeÚget_legend_handlerr6   r
   Úextend)r   r,   r$   r/   r0   r1   r2   r3   r?   Úhandler_mapr  rX   Ú	xds_cycleÚa_listÚhandle1ÚhandlerÚ_a_lists                    r   r6   zHandlerTuple.create_artistsä  s  € ð ×3Ò3Ñ5Ô5ˆàŒ=Ð Ý˜+Ñ&Ô&ˆGˆGà”mˆGàŒ9ÐØÔ" XÑ-ˆCˆCà”)˜hÑ&ˆCà�QŠ;ˆ;Ø˜S G¨a¡KÑ0Ñ0°GÑ;ˆEå˜( e¨c¡kµR´Y¸wÑ5GÔ5GÑ%GÑGÑHÔHˆ	àˆØ"ð 	#ð 	#ˆGØ×/Ò/°¸WÑEÔEˆGØ×,Ò,Ø˜Ý�Y‘” ¨5°&¸(ÀEñKô KˆGð �MŠM˜'Ñ"Ô"Ð"Ð"àˆr   )rT   N)r@   rA   rB   rC   r   r6   r\   r]   s   @r   r  r  Ï  sV   ø€ € € € € ðð ð#ð #ð #ð #ð #ð #ð ð ð ð ð ð ð r   r  c                   ó   — e Zd ZdZd„ Zd„ ZdS )ÚHandlerPolyCollectionza
    Handler for `.PolyCollection` used in `~.Axes.fill_between` and
    `~.Axes.stackplot`.
    c                 ó’  — d„ }d„ } ||                      ¦   «         ¦  «        |_         ||                     ¦   «         ¦  «        |_         ||                     ¦   «         ¦  «        |_        |j        |_        |j        |_        |                     ¦   «         |_	        | 
                    ¦   «         |_        |                      ||                     ¦   «         ¦  «        ¦  «         |                      ||                     ¦   «         ¦  «        ¦  «         |                      ||                     ¦   «         ¦  «        ¦  «         d S )Nc                 óF   — | j         dk    rdS t          | d         ¦  «        S )Nr   )r   r   r   r   )ÚsizeÚtuple)Úcolorss    r   Úfirst_colorz7HandlerPolyCollection._update_prop.<locals>.first_color
  s&   € ØŒ{˜aÒÐØ#�|Ý˜ œÑ#Ô#Ð#r   c                 ó4   — t          | ¦  «        r| d         S d S r©   )ru   )Ú
prop_arrays    r   Ú	get_firstz5HandlerPolyCollection._update_prop.<locals>.get_first  s   € Ý�:‰Œð Ø! !”}Ð$à�tr   )r–   Ú
_facecolorrš   Ú
_edgecolorÚget_hatchcolorÚ_hatch_colorÚ_original_facecolorÚ_original_edgecolorrŸ   Ú_fillr    Ú_hatchr®   rª   rv   Úget_linestylesr{   Úget_transforms)r   r#   r$   r/  r2  s        r   r%   z"HandlerPolyCollection._update_prop	  s>  € ð	$ð 	$ð 	$ð
	ð 	ð 	ð $/ ;¨{×/HÒ/HÑ/JÔ/JÑ#KÔ#KˆÔ Ø#. ;¨{×/HÒ/HÑ/JÔ/JÑ#KÔ#KˆÔ Ø%0 [°×1KÒ1KÑ1MÔ1MÑ%NÔ%NˆÔ"Ø,7Ô,KˆÔ)Ø,7Ô,KˆÔ)Ø)×2Ò2Ñ4Ô4ˆÔØ*×4Ò4Ñ6Ô6ˆÔà×#Ò# I I¨k×.HÒ.HÑ.JÔ.JÑ$KÔ$KÑLÔLÐLØ×#Ò# I I¨k×.HÒ.HÑ.JÔ.JÑ$KÔ$KÑLÔLÐLØ×#Ò# I I¨k×.HÒ.HÑ.JÔ.JÑ$KÔ$KÑLÔLÐLÐLÐLr   c	                 óŒ   — t          | | f||¬¦  «        }	|                      |	||¦  «         |	                     |¦  «         |	gS )NrŒ   )r   r-   r{   r‘   s
             r   r6   z$HandlerPolyCollection.create_artists$  sY   € õ ˜8˜) h YÐ/Ø!¨&ð2ñ 2ô 2ˆà×Ò˜˜K¨Ñ0Ô0Ð0Ø	�Š˜ÑÔÐØˆsˆ
r   N)r@   rA   rB   rC   r%   r6   rD   r   r   r)  r)    s?   € € € € € ðð ðMð Mð Mð6ð ð ð ð r   r)  )rC   Ú	itertoolsr   ÚnumpyrV   Ú
matplotlibr   Úmatplotlib.linesr   Úmatplotlib.patchesr   Úmatplotlib.collectionsÚcollectionsrð   r   r   rF   r_   rl   r�   r‡   r“   r£   r³   rÔ   rÙ   rÜ   r   r  r)  rD   r   r   ú<module>rE     sC  ððð ð: Ð Ð Ð Ð Ð à Ð Ð Ð à Ð Ð Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #Ø (Ð (Ð (Ð (Ð (Ð (Ø &Ð &Ð &Ð &Ð &Ð &ð%ð %ð %ðu;ð u;ð u;ð u;ð u;ñ u;ô u;ð u;ðp'#ð '#ð '#ð '#ð '#�[ñ '#ô '#ð '#ðTð ð ð ð ˜^ñ ô ð ð<")ð ")ð ")ð ")ð ")˜Nñ ")ô ")ð ")ðJ$ð $ð $ð $ð $�Nñ $ô $ð $ðN,ð ,ð ,ð ,ð ,�;ñ ,ô ,ð ,ð^"ð "ð "ð "ð "�{ñ "ô "ð "ðJð ð ð ð ˜Mñ ô ð ð@Fð Fð Fð Fð FÐ#9ñ Fô Fð FðR
ð 
ð 
ð 
ð 
Ð8ñ 
ô 
ð 
ðGð Gð Gð Gð GÐ:ñ Gô Gð Gðhð hð hð hð h�mñ hô hð hðVXDð XDð XDð XDð XDÐ(ñ XDô XDð XDðv2ð 2ð 2ð 2ð 2�;ñ 2ô 2ð 2ðj'ð 'ð 'ð 'ð '˜Kñ 'ô 'ð 'ð 'ð 'r   