ó
    {ñ:iÚÔ  ã                   óP  • S r SSKrSSKrSSKrSSKJrJr  SSKJ	r
  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJrJrJr  SSKJrJrJr  Sr S	 r!S
 r"S,S jr#S-S jr$ " S S\
RJ                  5      r& " S S\&5      r' " S S\'5      r( " S S\'5      r) " S S\&5      r* " S S\&5      r+ " S S\&5      r, " S S\&5      r- " S S\&5      r.S r/ " S  S!\.5      r0 " S" S#\&5      r1 " S$ S%\
RJ                  \Rd                  5      r3 " S& S'5      r4 " S( S)\45      r5 " S* S+\45      r6g).ac  
Container classes for `.Artist`\s.

`OffsetBox`
    The base of all container artists defined in this module.

`AnchoredOffsetbox`, `AnchoredText`
    Anchor and align an arbitrary `.Artist` or a text relative to the parent
    axes or a specific anchor point.

`DrawingArea`
    A container with fixed width and height. Children have a fixed position
    inside the container and may be clipped.

`HPacker`, `VPacker`
    Containers for layouting their children vertically or horizontally.

`PaddedBox`
    A container to add a padding around an `.Artist`.

`TextArea`
    Contains a single `.Text` instance.
é    N)Ú_apiÚ
_docstring)ÚFontProperties)Ú	BboxImage)ÚFancyBboxPatchÚFancyArrowPatchÚbbox_artist)ÚBboxÚBboxBaseÚTransformedBboxFc                 óV   ^ ^• S S /m[         R                  " T 5      U U4S j5       nU$ )zÒ
Decorator for the get_offset method of OffsetBox and subclasses, that
allows supporting both the new signature (self, bbox, renderer) and the old
signature (self, width, height, xdescent, ydescent, renderer).
c                 ó   • [        5       $ ©N©Úlocals)ÚselfÚwidthÚheightÚxdescentÚydescentÚrenderers         ÚW/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/matplotlib/offsetbox.pyÚ<lambda>Ú$_compat_get_offset.<locals>.<lambda>3   s   € ÄfÄhó    c                 ó   • [        5       $ r   r   ©r   Úbboxr   s      r   r   r   4   s   € ¬¬r   c                 ó¼   >• [         R                  " TU /UQ70 UD6nSU;   a  US   O&[        R                  " US   * US   * US   US   5      nT" US   XCS   5      $ )Nr   r   r   r   r   r   r   )r   Úselect_matching_signaturer
   Úfrom_bounds)r   ÚargsÚkwargsÚparamsr   ÚmethÚsigss        €€r   Ú
get_offsetÚ&_compat_get_offset.<locals>.get_offset6   s{   ø€ ä×/Ò/°°dÐL¸TÒLÀVÑLˆØ"(¨FÓ"2��v’Ü× Ò  &¨Ñ"4Ð!4°v¸jÑ7IÐ6IØ!'¨¡°&¸Ñ2BóDð 	ñ �F˜6‘N D°Ñ*<Ó=Ð=r   )Ú	functoolsÚwraps)r%   r'   r&   s   ` @r   Ú_compat_get_offsetr+   -   s8   ù€ ñ OÙ1ð3€Dô ‡_‚_�TÓõ>ó ð>ð Ðr   c                  ó2   • [         (       a  [        U 0 UD6  g g r   )ÚDEBUGÚmbbox_artist)r"   r#   s     r   Ú_bbox_artistr/   A   s   € ß‚uÜ�dÐ%˜fÓ%ð r   c                 ó†  • [         R                  " / SQUS9  US:X  a@  [        R                  " S/U  Vs/ s H  oDU-   PM	     sn-   5      nUSS nUc  US   U-
  nX4$ US:X  ai  Uc  Sn[	        U 5      S:”  a  U[        U 5      -
  [	        U 5      S-
  -  nOSn[        R                  " S/U  Vs/ s H  oDU-   PM	     sn-   5      nUSS nX4$ US	:X  ae  [        U 5      nUc  Uc  [        S
5      eXr-   [	        U 5      -  nOU[	        U 5      -  U-
  nXr-   [        R                  " [	        U 5      5      -  nX4$ gs  snf s  snf )aÇ  
Pack boxes specified by their *widths*.

For simplicity of the description, the terminology used here assumes a
horizontal layout, but the function works equally for a vertical layout.

There are three packing *mode*\s:

- 'fixed': The elements are packed tight to the left with a spacing of
  *sep* in between. If *total* is *None* the returned total will be the
  right edge of the last box. A non-*None* total will be passed unchecked
  to the output. In particular this means that right edge of the last
  box may be further to the right than the returned total.

- 'expand': Distribute the boxes with equal spacing so that the left edge
  of the first box is at 0, and the right edge of the last box is at
  *total*. The parameter *sep* is ignored in this mode. A total of *None*
  is accepted and considered equal to 1. The total is returned unchanged
  (except for the conversion *None* to 1). If the total is smaller than
  the sum of the widths, the laid out boxes will overlap.

- 'equal': If *total* is given, the total space is divided in N equal
  ranges and each box is left-aligned within its subspace.
  Otherwise (*total* is *None*), *sep* must be provided and each box is
  left-aligned in its subspace of width ``(max(widths) + sep)``. The
  total width is then calculated to be ``N * (max(widths) + sep)``.

Parameters
----------
widths : list of float
    Widths of boxes to be packed.
total : float or None
    Intended total length. *None* if not used.
sep : float or None
    Spacing between boxes.
mode : {'fixed', 'expand', 'equal'}
    The packing mode.

Returns
-------
total : float
    The total width needed to accommodate the laid out boxes.
offsets : array of float
    The left offsets of the boxes.
)ÚfixedÚexpandÚequal)Úmoder1   r   Néÿÿÿÿr2   é   r3   z@total and sep cannot both be None when using layout mode 'equal')	r   Úcheck_in_listÚnpÚcumsumÚlenÚsumÚmaxÚ
ValueErrorÚarange)ÚwidthsÚtotalÚsepr4   ÚwÚoffsets_ÚoffsetsÚmaxhs           r   Ú_get_packed_offsetsrF   F   s`  € ô\ 	×ÒÒ3¸$Ò?àˆwƒÜ—9’9˜a˜S±VÓ#<²V°¨¤G±VÑ#<Ñ<Ó=ˆØ˜3˜B�-ˆØ‰=Ø˜R‘L 3Ñ&ˆEØˆ~Ðà	�Ó	ð ‰=ØˆEÜˆv‹;˜‹?Øœ3˜v›;Ñ&¬3¨v«;¸©?Ñ;‰CàˆCÜ—9’9˜a˜S±VÓ#<²V°¨¤G±VÑ#<Ñ<Ó=ˆØ˜3˜B�-ˆØˆ~Ðà	�‹Ü�6‹{ˆØ‰=Ø‰{Ü ð "=ó >ð >à‘Z¤3 v£;Ñ.‰Eàœ#˜f›+Ñ%¨Ñ,ˆCØ‘:¤§¢¬3¨v«;Ó!7Ñ7ˆØˆ~Ðð 
ùò' $=ùò $=s   ´D9
Â.D>
c                 óæ  • [         R                  " / SQUS9  Uc  [        S U  5       5      nUS:X  a6  [        S U  5       5      [        S U  5       5      4nS/[	        U 5      -  nX44$ US;   a  SU4nU  VVs/ s H  u  pVU* PM
     nnnX44$ US	;   a  SU4nU  VVs/ s H	  u  pVX-
  PM     nnnX44$ US
:X  a%  SU4nU  VVs/ s H  u  pVXU-
  -
  S-  U-
  PM     nnnWW4$ s  snnf s  snnf s  snnf )ad  
Align boxes each specified by their ``(y0, y1)`` spans.

For simplicity of the description, the terminology used here assumes a
horizontal layout (i.e., vertical alignment), but the function works
equally for a vertical layout.

Parameters
----------
yspans
    List of (y0, y1) spans of boxes to be aligned.
height : float or None
    Intended total height. If None, the maximum of the heights
    (``y1 - y0``) in *yspans* is used.
align : {'baseline', 'left', 'top', 'right', 'bottom', 'center'}
    The alignment anchor of the boxes.

Returns
-------
(y0, y1)
    y range spanned by the packing.  If a *height* was originally passed
    in, then for all alignments other than "baseline", a span of ``(0,
    height)`` is used without checking that it is actually large enough).
descent
    The descent of the packing.
offsets
    The bottom offsets of the boxes.
)ÚbaselineÚleftÚtopÚrightÚbottomÚcenter)Úalignc              3   ó.   #   • U  H  u  pX!-
  v •  M     g 7fr   © ©Ú.0Úy0Úy1s      r   Ú	<genexpr>Ú'_get_aligned_offsets.<locals>.<genexpr>¸   s   é € Ð2ª6¡ �R–Wª6ùs   ‚rH   c              3   ó*   #   • U  H	  u  pUv •  M     g 7fr   rP   rQ   s      r   rU   rV   »   s   é € Ð-¢f™F˜B•R¢fùó   ‚c              3   ó*   #   • U  H	  u  pUv •  M     g 7fr   rP   rQ   s      r   rU   rV   »   s   é € Ð2KÂF¹&¸"µ2ÂFùrX   r   )rI   rL   )rK   rJ   rM   ç      à?)r   r7   r<   Úminr:   )Úyspansr   rN   ÚyspanrD   rS   rT   s          r   Ú_get_aligned_offsetsr^   —   s/  € ô< 	×ÒÚ@ÈòOà�~ÜÑ2©6Ó2Ó2ˆà�
ÓÜÑ-¡fÓ-Ó-¬sÑ2KÁFÓ2KÓ/KÐLˆØ�#œ˜F›Ñ#ˆð ˆ>Ðð 
Ð$Ó	$Ø�F�ˆÙ%+Ô,¢V™6˜2�B“3¡VˆÑ,ð ˆ>Ðð 
Ð"Ó	"Ø�F�ˆÙ-3Ô4ªV¡6 2�6”;©VˆÑ4ð
 ˆ>Ðð	 
�(Ó	Ø�F�ˆÙ@FÔGÂ±f°b�F 2™gÑ&¨"Ñ,¨rÔ1ÁˆÑGà�'ˆ>Ðùó -ùó 5ùó Hs   Á8C!ÂC'ÃC-c                   óÔ   ^ • \ rS rSrSrU 4S jrU 4S jr\R                  R                  R                  S 5       r	S rS r\S 5       rS	 rS
 rS rS rS rS rSS jrS rSrU =r$ )Ú	OffsetBoxéÊ   z¯
A simple container artist.

The child artists are meant to be drawn at a relative position to its
parent.

Being an artist itself, all parameters are passed on to `.Artist`.
c                 ó€   >• [         TU ]  " U6   U R                  U5        U R                  S5        / U l        SU l        g )NF©r   r   )ÚsuperÚ__init__Ú_internal_updateÚset_clip_onÚ	_childrenÚ_offset)r   r"   r#   Ú	__class__s      €r   re   ÚOffsetBox.__init__Ó   s<   ø€ Ü‰Ò˜$ÑØ×Ñ˜fÔ%ð 	×Ñ˜ÔØˆŒØˆ�r   c                 ót   >• [         TU ]  U5        U R                  5        H  nUR                  U5        M     g)zw
Set the `.Figure` for the `.OffsetBox` and all its children.

Parameters
----------
fig : `~matplotlib.figure.Figure`
N)rd   Ú
set_figureÚget_children)r   ÚfigÚcrj   s      €r   rm   ÚOffsetBox.set_figureÝ   s1   ø€ ô 	‰Ñ˜3ÔØ×"Ñ"Ö$ˆAØ�L‰L˜Öò %r   c                 óš   • [         R                  R                  R                  X5        U R	                  5        H  nUc  M  Xl        M     g r   )ÚmartistÚArtistÚaxesÚfsetrn   )r   Úaxrp   s      r   ru   ÚOffsetBox.axesé   s9   € ô 	�‰×Ñ× Ñ  Ô*Ø×"Ñ"Ö$ˆAØ‹}Ø–ò %r   c                 óª   • U R                  U5      (       a  S0 4$ U R                  5        H"  nUR                  U5      u  p4U(       d  M  X44s  $    S0 4$ )a  
Delegate the mouse event contains-check to the children.

As a container, the `.OffsetBox` does not respond itself to
mouseevents.

Parameters
----------
mouseevent : `~matplotlib.backend_bases.MouseEvent`

Returns
-------
contains : bool
    Whether any values are within the radius.
details : dict
    An artist-specific dictionary of details of the event context,
    such as which points are contained in the pick radius. See the
    individual Artist subclasses for details.

See Also
--------
.Artist.contains
F)Ú_different_canvasrn   Úcontains)r   Ú
mouseeventrp   ÚaÚbs        r   r{   ÚOffsetBox.containsñ   sZ   € ð0 ×!Ñ! *×-Ñ-Ø˜"�9ÐØ×"Ñ"Ö$ˆAØ—:‘:˜jÓ)‰DˆAßˆqØ�t’ñ %ð �bˆyÐr   c                 ó   • Xl         SU l        g)a‡  
Set the offset.

Parameters
----------
xy : (float, float) or callable
    The (x, y) coordinates of the offset in display units. These can
    either be given explicitly as a tuple (x, y), or by providing a
    function that converts the extent into the offset. This function
    must have the signature::

        def offset(width, height, xdescent, ydescent, renderer) -> (float, float)
TN)ri   Ústale©r   Úxys     r   Ú
set_offsetÚOffsetBox.set_offset  s   € ð ŒØˆ�
r   c                 óÌ   • [        U R                  5      (       a?  U R                  UR                  UR                  UR                  * UR
                  * U5      $ U R                  $ )a  
Return the offset as a tuple (x, y).

The extent parameters have to be provided to handle the case where the
offset is dynamically determined by a callable (see
`~.OffsetBox.set_offset`).

Parameters
----------
bbox : `.Bbox`
renderer : `.RendererBase` subclass
)Úcallableri   r   r   Úx0rS   r   s      r   r'   ÚOffsetBox.get_offset#  sP   € ô  ˜Ÿ™×%Ñ%ð �L‰L˜Ÿ™ T§[¡[°4·7±7°(¸T¿W¹W¸HÀhÓOð	ð —‘ð	r   c                 ó   • Xl         SU l        g)z@
Set the width of the box.

Parameters
----------
width : float
TN)r   r�   )r   r   s     r   Ú	set_widthÚOffsetBox.set_width6  s   € ð Œ
Øˆ�
r   c                 ó   • Xl         SU l        g)zB
Set the height of the box.

Parameters
----------
height : float
TN)r   r�   )r   r   s     r   Ú
set_heightÚOffsetBox.set_heightA  s   € ð ŒØˆ�
r   c                 ór   • U R                    Vs/ s H  oR                  5       (       d  M  UPM     sn$ s  snf )z/Return a list of the visible child `.Artist`\s.)rh   Úget_visible)r   rp   s     r   Úget_visible_childrenÚOffsetBox.get_visible_childrenL  s$   € àŸ>š>Ó=š>�a¯]©]¯_—™>Ñ=Ð=ùÒ=s   �4«4c                 ó   • U R                   $ )z'Return a list of the child `.Artist`\s.)rh   ©r   s    r   rn   ÚOffsetBox.get_childrenP  ó   € à�~‰~Ðr   c                 ó   • [        S5      e)zß
Return the bbox of the offsetbox and the child offsets.

The bbox should satisfy ``x0 <= x1 and y0 <= y1``.

Parameters
----------
renderer : `.RendererBase` subclass

Returns
-------
bbox
list of (xoffset, yoffset) pairs
z:get_bbox_and_offsets must be overridden in derived classes)ÚNotImplementedError©r   r   s     r   Ú_get_bbox_and_child_offsetsÚ%OffsetBox._get_bbox_and_child_offsetsT  s   € ô "ØHóJð 	Jr   c                 ó,   • U R                  U5      u  p#U$ )z:Return the bbox of the offsetbox, ignoring parent offsets.)r›   )r   r   r   rD   s       r   Úget_bboxÚOffsetBox.get_bboxf  s   € à×8Ñ8¸ÓB‰ˆØˆr   c                 óò   • Uc  U R                  SS9R                  5       nU R                  U5      n U R                  X!5      u  p4UR                  X45      $ ! [         a    U R                  5       u  p4 N/f = f©NT©Úroot)Ú
get_figureÚ_get_rendererrž   r'   Ú	TypeErrorÚ
translated)r   r   r   ÚpxÚpys        r   Úget_window_extentÚOffsetBox.get_window_extentk  sv   € àÑØ—‘¨D�Ð1×?Ñ?ÓAˆHØ�}‰}˜XÓ&ˆð	'Ø—_‘_ TÓ4‰FˆBð �‰˜rÓ&Ð&øô ó 	'Ø—_‘_Ó&‰FˆB‘ð	'ús   ³A ÁA6Á5A6c           	      ó  • U R                  U5      u  p#U R                  X!5      u  pE[        U R                  5       U5       H0  u  nu  pxUR	                  XG-   XX-   45        UR                  U5        M2     [        XS[        SS9S9  SU l        g)zU
Update the location of children if necessary and draw them
to the given *renderer*.
Fç        ©Úpad©ÚfillÚpropsN)	r›   r'   Úzipr’   r„   Údrawr/   Údictr�   ©	r   r   r   rD   r¨   r©   rp   ÚoxÚoys	            r   r´   ÚOffsetBox.drawv  s�   € ð
 ×8Ñ8¸ÓB‰ˆØ—‘ Ó0‰ˆÜ˜t×8Ñ8Ó:¸GÖD‰KˆA‰x�Ø�L‰L˜"™' 2¡7Ð+Ô,Ø�F‰F�8Öñ Eô 	�T¨%´tÀ±|ÒDØˆ�
r   )rh   ri   r   r�   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__re   rm   rs   rt   ru   Úsetterr{   r„   r+   r'   r‹   rŽ   r’   rn   r›   rž   rª   r´   Ú__static_attributes__Ú__classcell__©rj   s   @r   r`   r`   Ê   sƒ   ø† ñõõ
ð ‡^�^×Ñ×Ññó  ðòò@ð$ ñó ðò$	ò	ò>òòJò$ô
	'÷ð r   r`   c                   ó0   ^ • \ rS rSr  SU 4S jjrSrU =r$ )Ú
PackerBasei„  c                 óv   >• [         TU ]  5         X@l        X0l        X l        Xl        X`l        XPl        Xpl        g)a§  
Parameters
----------
pad : float, default: 0.0
    The boundary padding in points.

sep : float, default: 0.0
    The spacing between items in points.

width, height : float, optional
    Width and height of the container box in pixels, calculated if
    *None*.

align : {'top', 'bottom', 'left', 'right', 'center', 'baseline'}, default: 'baseline'
    Alignment of boxes.

mode : {'fixed', 'expand', 'equal'}, default: 'fixed'
    The packing mode.

    - 'fixed' packs the given `.Artist`\s tight with *sep* spacing.
    - 'expand' uses the maximal available space to distribute the
      artists with equal spacing in between.
    - 'equal': Each artist an equal fraction of the available space
      and is left-aligned (or top-aligned) therein.

children : list of `.Artist`
    The artists to pack.

Notes
-----
*pad* and *sep* are in points and will be scaled with the renderer
dpi, while *width* and *height* are in pixels.
N)	rd   re   r   r   rA   r¯   r4   rN   rh   )	r   r¯   rA   r   r   rN   r4   Úchildrenrj   s	           €r   re   ÚPackerBase.__init__…  s4   ø€ ôH 	‰ÑÔØŒØŒ
ØŒØŒØŒ	ØŒ
Ø!�r   )rh   rN   r   r4   r¯   rA   r   )r­   r­   NNrH   r1   N)rº   r»   r¼   r½   re   rÀ   rÁ   rÂ   s   @r   rÄ   rÄ   „  s   ø† Ø:>Ø:>÷+"õ +"r   rÄ   c                   ó   • \ rS rSrSrS rSrg)ÚVPackeri³  zÉ
VPacker packs its children vertically, automatically adjusting their
relative positions at draw time.

.. code-block:: none

   +---------+
   | Child 1 |
   | Child 2 |
   | Child 3 |
   +---------+
c                 óp  • UR                  S5      nU R                  U-  nU R                  U-  nU R                  b[  U R	                  5        HG  n[        U[        5      (       d  M  UR                  S:X  d  M,  UR                  U R                  5        MI     U R	                  5        Vs/ s H  oUR                  U5      PM     nn[        U Vs/ s H  owR                  PM     snU R                  U R                  5      u  u  p‰n
[        U Vs/ s H  owR                  PM     snU R                  X@R                  5      u  p¼X¼U Vs/ s H  owR                  PM     sn-   -
  nUS   nXÍ-
  n[         R"                  " X�* X˜-
  U5      R%                  U5      / ['        X¬5      Q4$ s  snf s  snf s  snf s  snf )Nç      ð?r2   r   )Úpoints_to_pixelsr¯   rA   r   r’   Ú
isinstancerÄ   r4   r‹   rž   r^   Ú	intervalxrN   rF   r   rT   r
   r!   Úpaddedr³   )r   r   Údpicorr¯   rA   rp   Úbboxesr   rˆ   Úx1Úxoffsetsr   Úyoffsetsr   s                 r   r›   Ú#VPacker._get_bbox_and_child_offsetsÁ  su  € à×*Ñ*¨2Ó.ˆØ�h‰h˜ÑˆØ�h‰h˜Ñˆà�:‰:Ñ!Ø×.Ñ.Ö0�Ü˜a¤×,Ó,°·±¸8Õ1CØ—K‘K §
¡
Ö+ñ 1ð 15×0IÑ0IÔ0KÓLÒ0K¨1—*‘*˜XÖ&Ñ0KˆÐLÜ1Ù(.Ó/ª �^Œ^©Ñ/°·±¸T¿Z¹ZóIÑ‰ˆ�(ä.Ù%+Ó,¢V˜T�[Œ[¡VÑ,¨d¯k©k¸3Ç	Á	óKÑˆð ¹VÓ(DºV°T¯¬¹VÑ(DÑDÑEˆØ˜A‘;ˆØÑ&ˆô ×Ò˜R ¨B©G°VÓ<×CÑCÀCÓHØ&Œc�(Ó%Ð&ð(ð 	(ùò Mùâ/ùâ,ùâ(Ds   Â*F$ÃF)ÄF.ÅF3rP   N©rº   r»   r¼   r½   r¾   r›   rÀ   rP   r   r   rÉ   rÉ   ³  s   † ñõ(r   rÉ   c                   ó   • \ rS rSrSrS rSrg)ÚHPackeriÛ  zï
HPacker packs its children horizontally, automatically adjusting their
relative positions at draw time.

.. code-block:: none

   +-------------------------------+
   | Child 1    Child 2    Child 3 |
   +-------------------------------+
c                 ó  • UR                  S5      nU R                  U-  nU R                  U-  nU R                  5        Vs/ s H  oUR	                  U5      PM     nnU(       d*  [
        R                  " SSSS5      R                  U5      / 4$ [        U Vs/ s H  owR                  PM     snU R                  U R                  5      u  u  p‰n
[        U Vs/ s H  owR                  PM     snU R                  X@R                  5      u  p¼US   R                  nXÆ Vs/ s H  owR                  PM     snU-
  -  n[
        R                  " XØX¹U-
  5      R                  U5      / [!        XÊ5      Q4$ s  snf s  snf s  snf s  snf )NrË   r   )rÌ   r¯   rA   r’   rž   r
   r!   rÏ   r^   Ú	intervalyr   rN   rF   r   r4   rˆ   r³   )r   r   rÐ   r¯   rA   rp   rÑ   r   rS   rT   rÔ   r   rÓ   rˆ   s                 r   r›   Ú#HPacker._get_bbox_and_child_offsetsç  sU  € à×*Ñ*¨2Ó.ˆØ�h‰h˜ÑˆØ�h‰h˜Ñˆà04×0IÑ0IÔ0KÓLÒ0K¨1—*‘*˜XÖ&Ñ0KˆÐLÞÜ×#Ò# A q¨!¨QÓ/×6Ñ6°sÓ;¸RÐ?Ð?ä1Ù(.Ó/ª �^Œ^©Ñ/°·±¸d¿j¹jóJÑ‰ˆ�(ä-Ù$*Ó+¢F˜D�ZŒZ¡FÑ+¨T¯Z©Z¸¿i¹ióI‰ˆð �A‰Y�\‰\ˆØ¨&Ó1ª& $—g”g©&Ñ1°BÑ6Ñ7ˆä× Ò  ¨°R±Ó8×?Ñ?ÀÓDØ*”#�hÓ)Ð*ð,ð 	,ùò Mùò
 0ùâ+ùò 2s   ÁE2ÂE7ÃE<ÄFrP   NrÖ   rP   r   r   rØ   rØ   Û  s   † ñ	õ,r   rØ   c                   óV   ^ • \ rS rSrSrSSSS.U 4S jjjrS rS rSS	 jrS
 r	Sr
U =r$ )Ú	PaddedBoxiý  aŸ  
A container to add a padding around an `.Artist`.

The `.PaddedBox` contains a `.FancyBboxPatch` that is used to visualize
it when rendering.

.. code-block:: none

   +----------------------------+
   |                            |
   |                            |
   |                            |
   | <--pad--> Artist           |
   |             ^              |
   |            pad             |
   |             v              |
   +----------------------------+

Attributes
----------
pad : float
    The padding in points.
patch : `.FancyBboxPatch`
    When *draw_frame* is True, this `.FancyBboxPatch` is made visible and
    creates a border around the box.
FN)Ú
draw_frameÚpatch_attrsc                ó¨   >• [         TU ]  5         X l        U/U l        [	        SSSSSSSUSS9	U l        Ub  U R
                  R                  U5        g	g	)
a®  
Parameters
----------
child : `~matplotlib.artist.Artist`
    The contained `.Artist`.
pad : float, default: 0.0
    The padding in points. This will be scaled with the renderer dpi.
    In contrast, *width* and *height* are in *pixels* and thus not
    scaled.
draw_frame : bool
    Whether to draw the contained `.FancyBboxPatch`.
patch_attrs : dict or None
    Additional parameters passed to the contained `.FancyBboxPatch`.
©r­   r­   rË   rB   Úkr6   Túsquare,pad=0©	rƒ   r   r   Ú	facecolorÚ	edgecolorÚmutation_scaleÚsnapÚvisibleÚboxstyleN)rd   re   r¯   rh   r   ÚpatchÚupdate)r   Úchildr¯   rÞ   rß   rj   s        €r   re   ÚPaddedBox.__init__  sa   ø€ ô 	‰ÑÔØŒØ˜ˆŒÜ#Ø ¨BØ SØØØØ#ñ
ˆŒ
ð Ñ"Ø�J‰J×Ñ˜kÕ*ð #r   c                 óž   • U R                   UR                  S5      -  nU R                  S   R                  U5      R	                  U5      S/4$ )NrË   r   rc   )r¯   rÌ   rh   rž   rÏ   )r   r   r¯   s      r   r›   Ú%PaddedBox._get_bbox_and_child_offsets6  sG   € à�h‰h˜×2Ñ2°2Ó6Ñ6ˆØ—‘˜qÑ!×*Ñ*¨8Ó4×;Ñ;¸CÓ@À6À(ÐKÐKr   c                 óJ  • U R                  U5      u  p#U R                  X!5      u  pE[        U R                  5       U5       H  u  nu  pxUR	                  XG-   XX-   45        M!     U R                  U5        U R                  5        H  nUR                  U5        M     SU l        g ©NF)r›   r'   r³   r’   r„   rÞ   r´   r�   r¶   s	            r   r´   ÚPaddedBox.draw;  s�   € à×8Ñ8¸ÓB‰ˆØ—‘ Ó0‰ˆÜ˜t×8Ñ8Ó:¸GÖD‰KˆA‰x�Ø�L‰L˜"™' 2¡7Ð+Ö,ñ Eð 	�‰˜Ô!à×*Ñ*Ö,ˆAØ�F‰F�8Öñ -ð ˆ�
r   c                 ó    • U R                   R                  UR                  5        U(       a  U R                   R                  U5        SU l        g ©NT)rë   Ú
set_boundsÚboundsÚset_mutation_scaler�   ©r   r   Úfontsizes      r   Úupdate_frameÚPaddedBox.update_frameI  s4   € Ø�
‰
×Ñ˜dŸk™kÔ*ÞØ�J‰J×)Ñ)¨(Ô3Øˆ�
r   c                 óz   • U R                  U R                  U5      5        U R                  R                  U5        g r   )rû   rª   rë   r´   rš   s     r   rÞ   ÚPaddedBox.draw_frameO  s+   € à×Ñ˜$×0Ñ0°Ó:Ô;Ø�
‰
�‰˜Õ!r   )rh   r¯   rë   r�   )r­   r   )rº   r»   r¼   r½   r¾   re   r›   r´   rû   rÞ   rÀ   rÁ   rÂ   s   @r   rÝ   rÝ   ý  s5   ø† ñð6+°EÀt÷ +ñ +ò:Lò
ô÷"ð "r   rÝ   c                   óŽ   ^ • \ rS rSrSrSU 4S jjr\S 5       r\R                  S 5       rS r	S r
S rS	 rS
 rS rS rSrU =r$ )ÚDrawingAreaiU  zÙ
The DrawingArea can contain any Artist as a child. The DrawingArea
has a fixed width and height. The position of children relative to
the parent is fixed. The children can be clipped at the
boundaries of the parent.
c                 óÆ   >• [         TU ]  5         Xl        X l        X0l        X@l        XPl        [        R                  " 5       U l	        [        R                  " 5       U l
        g)zÚ
Parameters
----------
width, height : float
    Width and height of the container box.
xdescent, ydescent : float
    Descent of the box in x- and y-direction.
clip : bool
    Whether to clip the children to the box.
N)rd   re   r   r   r   r   Ú_clip_childrenÚmtransformsÚAffine2DÚoffset_transformÚdpi_transform)r   r   r   r   r   Úcliprj   s         €r   re   ÚDrawingArea.__init__]  sL   ø€ ô 	‰ÑÔØŒ
ØŒØ ŒØ ŒØ"ÔÜ +× 4Ò 4Ó 6ˆÔÜ(×1Ò1Ó3ˆÕr   c                 ó   • U R                   $ )zT
If the children of this DrawingArea should be clipped
by DrawingArea bounding box.
)r  r•   s    r   Úclip_childrenÚDrawingArea.clip_childrenq  s   € ð ×"Ñ"Ð"r   c                 ó2   • [        U5      U l        SU l        g rõ   )Úboolr  r�   )r   Úvals     r   r
  r  y  s   € ä" 3›iˆÔØˆ�
r   c                 ó4   • U R                   U R                  -   $ )zH
Return the `~matplotlib.transforms.Transform` applied to the children.
)r  r  r•   s    r   Úget_transformÚDrawingArea.get_transform~  s   € ð ×!Ñ! D×$9Ñ$9Ñ9Ð9r   c                 ó   • g©z
set_transform is ignored.
NrP   ©r   Úts     r   Úset_transformÚDrawingArea.set_transform„  ó   � r   c                 ó–   • Xl         U R                  R                  5         U R                  R                  US   US   5        SU l        g©zˆ
Set the offset of the container.

Parameters
----------
xy : (float, float)
    The (x, y) coordinates of the offset in display units.
r   r6   TN©ri   r  ÚclearÚ	translater�   r‚   s     r   r„   ÚDrawingArea.set_offset‰  ó@   € ð ŒØ×Ñ×#Ñ#Ô%Ø×Ñ×'Ñ'¨¨1©¨r°!©uÔ5Øˆ�
r   c                 ó   • U R                   $ ©zReturn offset of the container.©ri   r•   s    r   r'   ÚDrawingArea.get_offset—  ó   € à�|‰|Ðr   c                 óÂ   • UR                  S5      n[        R                  " U R                  * U-  U R                  * U-  U R
                  U-  U R                  U-  5      $ )NrË   )rÌ   r
   r!   r   r   r   r   )r   r   Údpi_cors      r   rž   ÚDrawingArea.get_bbox›  sW   € à×+Ñ+¨BÓ/ˆÜ×ÒØ�]‰]ˆN˜WÑ$ t§}¡} n°wÑ&>Ø�J‰J˜Ñ  $§+¡+°Ñ"7ó9ð 	9r   c                 ó&  • U R                   R                  U5        UR                  5       (       d  UR                  U R	                  5       5        U R
                  b  U R
                  Ul        U R                  SS9nUb  UR                  U5        gg)ú&Add an `.Artist` to the container box.NFr¢   )rh   ÚappendÚis_transform_setr  r  ru   r¤   rm   )r   r}   ro   s      r   Ú
add_artistÚDrawingArea.add_artist¢  ss   € à�‰×Ñ˜aÔ Ø×!Ñ!×#Ñ#Ø�O‰O˜D×.Ñ.Ó0Ô1Ø�9‰9Ñ Ø—Y‘YˆAŒFØ�o‰o 5ˆoÐ)ˆØ‰?Ø�L‰L˜Õð r   c           	      ól  • UR                  S5      nU R                  R                  5         U R                  R                  U5        [        R
                  " [        R                  " SS/SU R                  /U R                  U R                  /U R                  S//5      U R                  5       5      nU R                   HX  nU R                  (       a3  UR                  (       d"  UR                  (       d  UR                  U5        UR!                  U5        MZ     [#        XS[%        SS9S9  SU l        g )NrË   r   Fr­   r®   r°   )rÌ   r  r  Úscaler  ÚTransformedPathÚmpathÚPathr   r   r  rh   r  ÚclipboxÚ	_clippathÚset_clip_pathr´   r/   rµ   r�   )r   r   r&  Útpathrp   s        r   r´   ÚDrawingArea.draw­  sí   € ð ×+Ñ+¨BÓ/ˆØ×Ñ× Ñ Ô"Ø×Ñ× Ñ  Ô)ô
 ×+Ò+Ü�JŠJ˜˜A˜  D§K¡KÐ 0ØŸ™ T§[¡[Ð1ØŸ™ Q˜ð)ó *ð ×ÑÓ ó	"ˆð
 —”ˆAØ×"×"¨A¯I¯I¸¿¿Ø—‘ Ô&Ø�F‰F�8Öñ  ô
 	�T¨%´tÀ±|ÒDØˆ�
r   )	r  ri   r  r   r  r�   r   r   r   )r­   r­   F)rº   r»   r¼   r½   r¾   re   Úpropertyr
  r¿   r  r  r„   r'   rž   r,  r´   rÀ   rÁ   rÂ   s   @r   r   r   U  sc   ø† ñ÷4ð( ñ#ó ð#ð ×Ññó ðò:òò
òò9ò	÷ð r   r   c                   ól   ^ • \ rS rSrSrSSS.U 4S jjrS rS rS	 rS
 r	S r
S rS rS rS rSrU =r$ )ÚTextAreaiÅ  zá
The TextArea is a container artist for a single Text instance.

The text is placed at (0, 0) with baseline+left alignment, by default. The
width and height of the TextArea instance is the width and height of its
child text.
NF)Ú	textpropsÚmultilinebaselinec                ód  >• Uc  0 n[         R                  " SSU40 UD6U l        [        TU ]  5         U R                  /U l        [        R                  " 5       U l        [        R                  " 5       U l	        U R                  R                  U R                  U R                  -   5        X0l        g)ac  
Parameters
----------
s : str
    The text to be displayed.
textprops : dict, default: {}
    Dictionary of keyword parameters to be passed to the `.Text`
    instance in the TextArea.
multilinebaseline : bool, default: False
    Whether the baseline for multiline text is adjusted so that it
    is (approximately) center-aligned with single-line text.
Nr   )ÚmtextÚTextÚ_textrd   re   rh   r  r  r  Ú_baseline_transformr  Ú_multilinebaseline)r   Úsr;  r<  rj   s       €r   re   ÚTextArea.__init__Î  s‘   ø€ ð" ÑØˆIÜ—Z’Z  1 aÑ5¨9Ñ5ˆŒ
Ü‰ÑÔØŸ*™*˜ˆŒÜ +× 4Ò 4Ó 6ˆÔÜ#.×#7Ò#7Ó#9ˆÔ Ø�
‰
× Ñ  ×!6Ñ!6Ø!%×!9Ñ!9ñ":ô 	;à"3Õr   c                 óH   • U R                   R                  U5        SU l        g)z&Set the text of this area as a string.TN)r@  Úset_textr�   ©r   rC  s     r   rF  ÚTextArea.set_textê  s   € à�
‰
×Ñ˜AÔØˆ�
r   c                 ó6   • U R                   R                  5       $ )z5Return the string representation of this area's text.)r@  Úget_textr•   s    r   rJ  ÚTextArea.get_textï  s   € à�z‰z×"Ñ"Ó$Ð$r   c                 ó   • Xl         SU l        g)a(  
Set multilinebaseline.

If True, the baseline for multiline text is adjusted so that it is
(approximately) center-aligned with single-line text.  This is used
e.g. by the legend implementation so that single-line labels are
baseline-aligned, but multiline labels are "center"-aligned with them.
TN)rB  r�   r  s     r   Úset_multilinebaselineÚTextArea.set_multilinebaselineó  s   € ð #$ÔØˆ�
r   c                 ó   • U R                   $ )z
Get multilinebaseline.
)rB  r•   s    r   Úget_multilinebaselineÚTextArea.get_multilinebaselineÿ  s   € ð ×&Ñ&Ð&r   c                 ó   • gr  rP   r  s     r   r  ÚTextArea.set_transform  r  r   c                 ó–   • Xl         U R                  R                  5         U R                  R                  US   US   5        SU l        gr  r  r‚   s     r   r„   ÚTextArea.set_offset
  r  r   c                 ó   • U R                   $ r!  r"  r•   s    r   r'   ÚTextArea.get_offset  r$  r   c           
      ó   • [         R                  " USU R                  R                  U R                  R	                  5       (       a  SOSU R                  SS9R                  S9u  p#nU R                  R                  U5      u  pVnUR                  u  p‰U R                  R                  5         [        U5      S:”  a?  U R                  (       a.  SU	-  SX4-
  -  -
  n
U R                  R                  S	Xz-
  5        U
nO[        X4-
  X—-
  5      nX·-   n	U R                  R                  5       nS	U* S
-  U* S.U   n[         R"                  " X×* X‰5      $ )NÚlpÚTeXFTr¢   )ÚismathÚdpir6   rZ   r   é   )rI   rM   rK   )r>  Ú_get_text_metrics_with_cacher@  Ú_fontpropertiesÚ
get_usetexr¤   r\  Ú_get_layoutÚsizerA  r  r:   rB  r  r<   Úget_horizontalalignmentr
   r!   )r   r   Ú_Úh_Úd_r   ÚinfoÚydrB   ÚhÚyd_newÚh_dÚharˆ   s                 r   rž   ÚTextArea.get_bbox  s$  € Ü×6Ò6Ø�d˜DŸJ™J×6Ñ6Ø ŸJ™J×1Ñ1×3Ñ3‘5¸Ø—‘ T�Ð*×.Ñ.ñ0‰	ˆˆrð
 Ÿ™×/Ñ/°Ó9‰ˆ�BØ�y‰y‰ˆà× Ñ ×&Ñ&Ô(äˆt‹9�q‹=˜T×4×4Ø˜1‘W˜s b¡g™Ñ.ˆFØ×$Ñ$×.Ñ.¨q°"±+Ô>Ø‰Bä�b‘g˜q™vÓ&ˆCØ‘ˆAà�Z‰Z×/Ñ/Ó1ˆØ A 2¨¡6°Q°BÑ7¸Ñ;ˆä×Ò  C¨Ó.Ð.r   c           	      ól   • U R                   R                  U5        [        XS[        SS9S9  SU l        g ©NFr­   r®   r°   )r@  r´   r/   rµ   r�   rš   s     r   r´   ÚTextArea.draw4  s)   € à�
‰
�‰˜Ô!Ü�T¨%´tÀ±|ÒDØˆ�
r   )rA  rh   rB  ri   r@  r  r�   )rº   r»   r¼   r½   r¾   re   rF  rJ  rM  rP  r  r„   r'   rž   r´   rÀ   rÁ   rÂ   s   @r   r:  r:  Å  sL   ø† ñð  Ø#(÷4ð 4ò8ò
%ò
ò'òò
òò/÷0ð r   r:  c                   óV   ^ • \ rS rSrSrU 4S jrS rS rS rS r	S r
S	 rS
 rSrU =r$ )ÚAuxTransformBoxi;  aY  
An OffsetBox with an auxiliary transform.

All child artists are first transformed with *aux_transform*, then
translated with an offset (the same for all children) so the bounding
box of the children matches the drawn box.  (In other words, adding an
arbitrary translation to *aux_transform* has no effect as it will be
cancelled out by the later offsetting.)

`AuxTransformBox` is similar to `.DrawingArea`, except that the extent of
the box is not predetermined but calculated from the window extent of its
children, and the extent of the children will be calculated in the
transformed coordinate.
c                 ó–   >• Xl         [        TU ]	  5         [        R                  " 5       U l        [        R                  " 5       U l        g r   )Úaux_transformrd   re   r  r  r  Úref_offset_transform)r   rt  rj   s     €r   re   ÚAuxTransformBox.__init__J  s8   ø€ Ø*ÔÜ‰ÑÔÜ +× 4Ò 4Ó 6ˆÔô %0×$8Ò$8Ó$:ˆÕ!r   c                 ó†   • U R                   R                  U5        UR                  U R                  5       5        SU l        g)r)  TN)rh   r*  r  r  r�   )r   r}   s     r   r,  ÚAuxTransformBox.add_artistR  s0   € à�‰×Ñ˜aÔ Ø	�‰˜×*Ñ*Ó,Ô-Øˆ�
r   c                 óN   • U R                   U R                  -   U R                  -   $ )z0Return the `.Transform` applied to the children.)rt  ru  r  r•   s    r   r  ÚAuxTransformBox.get_transformX  s,   € à×"Ñ"Ø×+Ñ+ñ,à×'Ñ'ñ(ð 	)r   c                 ó   • gr  rP   r  s     r   r  ÚAuxTransformBox.set_transform^  r  r   c                 ó–   • Xl         U R                  R                  5         U R                  R                  US   US   5        SU l        gr  r  r‚   s     r   r„   ÚAuxTransformBox.set_offsetc  r  r   c                 ó   • U R                   $ r!  r"  r•   s    r   r'   ÚAuxTransformBox.get_offsetq  r$  r   c                 ó  • U R                   R                  5       nU R                  R                  5         U R                   R                  5         U R                   Vs/ s H  o3R                  U5      PM     nn[        R                  " U5      nU R                  R                  UR                  * UR                  * 5        U R                   R                  U5        [        R                  " SSUR                  UR                  5      $ s  snf ©Nr   )r  Ú
get_matrixru  r  rh   rª   r
   Úunionr  rˆ   rS   Ú
set_matrixr!   r   r   )r   r   Ú_offrp   rÑ   Úubs         r   rž   ÚAuxTransformBox.get_bboxu  sÄ   € à×$Ñ$×/Ñ/Ó1ˆØ×!Ñ!×'Ñ'Ô)Ø×Ñ×#Ñ#Ô%à9=¿ºÓHº°A×%Ñ% hÖ/¹ˆÐHÜ�ZŠZ˜Óˆà×!Ñ!×+Ñ+¨R¯U©U¨F°R·U±U°FÔ;à×Ñ×(Ñ(¨Ô.Ü×Ò  1 b§h¡h°·	±	Ó:Ð:ùò Is   ÁD	c           	      ó~   • U R                    H  nUR                  U5        M     [        XS[        SS9S9  SU l        g ro  )rh   r´   r/   rµ   r�   )r   r   rp   s      r   r´   ÚAuxTransformBox.drawƒ  s3   € à—”ˆAØ�F‰F�8Öñ  ä�T¨%´tÀ±|ÒDØˆ�
r   )ri   rt  r  ru  r�   )rº   r»   r¼   r½   r¾   re   r,  r  r  r„   r'   rž   r´   rÀ   rÁ   rÂ   s   @r   rr  rr  ;  s5   ø† ñõ;òò)òò
òò;÷ð r   rr  c                   ó¦   ^ • \ rS rSrSrSrSSSSSSS	S
SSS.
rSSSSSSSS.U 4S jjrS rS r	S r
S rS rSS jr\S 5       rSS jrS rSrU =r$ )ÚAnchoredOffsetboxi‹  a  
An OffsetBox placed according to location *loc*.

AnchoredOffsetbox has a single child.  When multiple children are needed,
use an extra OffsetBox to enclose them.  By default, the offset box is
anchored against its parent Axes. You may explicitly specify the
*bbox_to_anchor*.
é   r6   r]  é   é   é   é   é   é	   é
   )
zupper rightz
upper leftz
lower leftzlower rightrK   zcenter leftzcenter rightzlower centerzupper centerrM   çš™™™™™Ù?rZ   NT)r¯   Ú	borderpadrí   ÚpropÚframeonÚbbox_to_anchorÚbbox_transformc                ó\  >• [         T
U ]  " S0 U	D6  U R                  Xx5        U R                  U5        [	        U[
        5      (       a  [        R                  " U R                  US9nXl	        X0l
        X l        Uc   [        [        R                  S   S9U l        Ob[        R                   " U5      U l        [	        U["        5      (       a2  SU;  a,  U R                  R%                  [        R                  S   5        ['        SSSSS	U R                  R)                  5       S
USS9	U l        g)a�  
Parameters
----------
loc : str
    The box location.  Valid locations are
    'upper left', 'upper center', 'upper right',
    'center left', 'center', 'center right',
    'lower left', 'lower center', 'lower right'.
    For backward compatibility, numeric values are accepted as well.
    See the parameter *loc* of `.Legend` for details.
pad : float, default: 0.4
    Padding around the child as fraction of the fontsize.
borderpad : float, default: 0.5
    Padding between the offsetbox frame and the *bbox_to_anchor*.
child : `.OffsetBox`
    The box that will be anchored.
prop : `.FontProperties`
    This is only used as a reference for paddings. If not given,
    :rc:`legend.fontsize` is used.
frameon : bool
    Whether to draw a frame around the box.
bbox_to_anchor : `.BboxBase`, 2-tuple, or 4-tuple of floats
    Box that is used to position the legend in conjunction with *loc*.
bbox_transform : None or :class:`matplotlib.transforms.Transform`
    The transform for the bounding box (*bbox_to_anchor*).
**kwargs
    All other parameters are passed on to `.OffsetBox`.

Notes
-----
See `.Legend` for a detailed description of the anchoring mechanism.
)ÚlocNúlegend.fontsize©rb  rb  rá   rË   rB   râ   Trã   rä   rP   )rd   re   Úset_bbox_to_anchorÚ	set_childrÍ   Ústrr   Úcheck_getitemÚcodesrœ  r–  r¯   r   ÚmplÚrcParamsr—  Ú	_from_anyrµ   Úset_sizer   Úget_size_in_pointsrë   )r   rœ  r¯   r–  rí   r—  r˜  r™  rš  r#   rj   s             €r   re   ÚAnchoredOffsetbox.__init__£  sð   ø€ ôL 	‰ÒÑ"˜6Ò"à×Ñ Ô?Ø�‰�uÔä�cœ3×ÑÜ×$Ò$ T§Z¡Z°SÑ9ˆCàŒØ"ŒØŒà‰<Ü&¬C¯L©LÐ9JÑ,KÑLˆD�Iä&×0Ò0°Ó6ˆDŒIÜ˜$¤×%Ñ%¨&¸Ó*<Ø—	‘	×"Ñ"¤3§<¡<Ð0AÑ#BÔCä#Ø ¨BØ SØŸ9™9×7Ñ7Ó9ØØØ#ñ
ˆ�
r   c                 óF   • Xl         Ub  U R                  Ul        SU l        g)zSet the child to be anchored.NT)Ú_childru   r�   )r   rí   s     r   r   ÚAnchoredOffsetbox.set_childå  s   € àŒØÑØŸ™ˆEŒJØˆ�
r   c                 ó   • U R                   $ )zReturn the child.©r«  r•   s    r   Ú	get_childÚAnchoredOffsetbox.get_childì  s   € à�{‰{Ðr   c                 ó   • U R                   /$ )zReturn the list of children.r®  r•   s    r   rn   ÚAnchoredOffsetbox.get_childrenð  s   € à—‘ˆ}Ðr   c                 óÎ   • UR                  U R                  R                  5       5      nU R                  U-  nU R	                  5       R                  U5      R                  U5      $ r   )rÌ   r—  r¨  r¯   r¯  rž   rÏ   )r   r   rú   r¯   s       r   rž   ÚAnchoredOffsetbox.get_bboxô  sP   € à×,Ñ,¨T¯Y©Y×-IÑ-IÓ-KÓLˆØ�h‰h˜Ñ!ˆØ�~‰~Ó×(Ñ(¨Ó2×9Ñ9¸#Ó>Ð>r   c                 óª   • U R                   c  U R                  R                  $ U R                  nUc  U R                   $ [	        U R                   U5      $ )z,Return the bbox that the box is anchored to.)Ú_bbox_to_anchorru   r   Ú_bbox_to_anchor_transformr   )r   Ú	transforms     r   Úget_bbox_to_anchorÚ$AnchoredOffsetbox.get_bbox_to_anchorú  sL   € à×ÑÑ'Ø—9‘9—>‘>Ð!à×6Ñ6ˆIØÑ Ø×+Ñ+Ð+ä& t×';Ñ';¸YÓGÐGr   c                 ó
  • Ub  [        U[        5      (       a  Xl        O6 [        U5      nUS:X  a  US   US   SS/n[        R                  " U6 U l        X l        SU l	        g! [         a  n[        SU 35      UeSnAff = f)a  
Set the bbox that the box is anchored to.

*bbox* can be a Bbox instance, a list of [left, bottom, width,
height], or a list of [left, bottom] where the width and
height will be assumed to be zero. The bbox will be
transformed to display coordinate by the given transform.
NzInvalid bbox: r]  r   r6   T)
rÍ   r   r¶  r:   r¦   r=   r
   r!   r·  r�   )r   r   r¸  ÚlÚerrs        r   rŸ  Ú$AnchoredOffsetbox.set_bbox_to_anchor  s‘   € ð ‰<œ: d¬H×5Ñ5Ø#'Õ ðCÜ˜“I�ð �A‹vØ˜Q™  a¡¨!¨QÐ/�ä#'×#3Ò#3°TÐ#:ˆDÔ à)2Ô&Øˆ�
øô ó CÜ  >°$°Ð!8Ó9¸sÐBûðCús   ¡A$ Á$
BÁ.A=Á=Bc           	      óN  • U R                   UR                  U R                  R                  5       5      -  nU R	                  5       n[        U R                  [        R                  " SSUR                  UR                  5      XC5      u  pVXQR                  -
  XaR                  -
  4$ r‚  )r–  rÌ   r—  r¨  r¹  Ú_get_anchored_bboxrœ  r
   r!   r   r   rˆ   rS   )r   r   r   r¯   r™  rˆ   rS   s          r   r'   ÚAnchoredOffsetbox.get_offset  s†   € ð �~‰~Ø×*Ñ*¨4¯9©9×+GÑ+GÓ+IÓJñKˆà×0Ñ0Ó2ˆÜ#Ø�H‰H”d×&Ò& q¨!¨T¯Z©Z¸¿¹ÓEØó!‰ˆð —G‘G‰|˜R§'¡'™\Ð)Ð)r   c                 ó”   • U R                   R                  UR                  5        U(       a  U R                   R                  U5        g g r   )rë   rö   r÷   rø   rù   s      r   rû   ÚAnchoredOffsetbox.update_frame)  s2   € Ø�
‰
×Ñ˜dŸk™kÔ*ÞØ�J‰J×)Ñ)¨(Õ3ð r   c                 óÎ  • U R                  5       (       d  g U R                  U5      nUR                  U R                  R	                  5       5      nU R                  X#5        U R                  R                  U5        U R                  U R                  U5      U5      u  pEU R                  5       R                  XE45        U R                  5       R                  U5        SU l        g rò   )r‘   rª   rÌ   r—  r¨  rû   rë   r´   r'   rž   r¯  r„   r�   )r   r   r   rú   r¨   r©   s         r   r´   ÚAnchoredOffsetbox.draw.  s¯   € à×Ñ×!Ñ!Øð ×%Ñ% hÓ/ˆØ×,Ñ,¨T¯Y©Y×-IÑ-IÓ-KÓLˆØ×Ñ˜$Ô)Ø�
‰
�‰˜Ô!à—‘ §¡¨xÓ!8¸(ÓC‰ˆØ�‰Ó×#Ñ# R HÔ-Ø�‰Ó×Ñ˜hÔ'Øˆ�
r   )	r¶  r·  r«  r–  rœ  r¯   rë   r—  r�   r   )rº   r»   r¼   r½   r¾   Úzorderr£  re   r   r¯  rn   rž   r¹  rŸ  r+   r'   rû   r´   rÀ   rÁ   rÂ   s   @r   rŒ  rŒ  ‹  s™   ø† ñð €Fð ØØØØØØØØØñ
€Eð  CØ $°Ø $Ø $÷	@
ð @
òDòòò?ò	Hôð2 ñ*ó ð*ô4÷
ð r   rŒ  c                 óf   • / SQU    nUR                  U* 5      nUR                  XES9R                  $ )zq
Return the (x, y) position of the *bbox* anchored at the *parentbbox* with
the *loc* code with the *borderpad*.
)NÚNEÚNWÚSWÚSEÚEÚWrÌ  ÚSÚNÚC)Ú	container)rÏ   ÚanchoredÚp0)rœ  r   Ú
parentbboxr–  rp   rÑ  s         r   rÀ  rÀ  ?  s8   € ò 	EÀSÑI€AØ×!Ñ! 9 *Ó-€IØ�=‰=˜ˆ=Ð0×3Ñ3Ð3r   c                   ó8   ^ • \ rS rSrSrSSSS.U 4S jjrSrU =r$ )	ÚAnchoredTextiK  z
AnchoredOffsetbox with Text.
r•  rZ   N)r¯   r–  r—  c                óö   >• Uc  0 nSS1nU[        U5      -  (       a  [        S5      e[        XS9U l        U R                  R                  R                  5       n[        T	U ]  " U4X4U R                  US.UD6  g)añ  
Parameters
----------
s : str
    Text.

loc : str
    Location code. See `AnchoredOffsetbox`.

pad : float, default: 0.4
    Padding around the text as fraction of the fontsize.

borderpad : float, default: 0.5
    Spacing between the offsetbox frame and the *bbox_to_anchor*.

prop : dict, optional
    Dictionary of keyword parameters to be passed to the
    `~matplotlib.text.Text` instance contained inside AnchoredText.

**kwargs
    All other parameters are passed to `AnchoredOffsetbox`.
NÚvaÚverticalalignmentz<Mixing verticalalignment with AnchoredText is not supported.)r;  )r¯   r–  rí   r—  )Úsetr=   r:  Útxtr@  Úget_fontpropertiesrd   re   )
r   rC  rœ  r¯   r–  r—  r#   Ú	badkwargsÚfprj   s
            €r   re   ÚAnchoredText.__init__P  s„   ø€ ð0 ‰<ØˆDØÐ.Ð/ˆ	Ø”s˜4“y× ÜØNóPð Pô ˜AÑ.ˆŒØ�X‰X�^‰^×.Ñ.Ó0ˆÜ‰ÒØð	Ø°T·X±XÀBñ	àó	r   )rÛ  )rº   r»   r¼   r½   r¾   re   rÀ   rÁ   rÂ   s   @r   rÖ  rÖ  K  s   ø† ñð '*°S¸t÷ #ö #r   rÖ  c            
       óp   ^ • \ rS rSrSSSSSSSSSS.	U 4S jjrS	 rS
 rS rS rS r	S r
S rS rSrU =r$ )ÚOffsetImageiv  r6   NTg      @F)	ÚzoomÚcmapÚnormÚinterpolationÚoriginÚ
filternormÚ	filterradÚresampler&  c       	         óÜ   >• [         TU ]  5         X l        [        SU R                  UUUUUUU	S.UD6U l        U R
                  /U l        U R                  U5        U R                  U5        g )N)r   rã  rä  rå  ræ  rç  rè  ré  rP   )	rd   re   Ú_dpi_corr   rª   Úimagerh   Úset_zoomÚset_data)r   Úarrrâ  rã  rä  rå  ræ  rç  rè  ré  r&  r#   rj   s               €r   re   ÚOffsetImage.__init__x  st   ø€ ô 	‰ÑÔØŒäð 	! D×$:Ñ$:Ø$(Ø$(Ø-:Ø&,Ø*4Ø)2Ø(0ñ	!ð "(ñ	!ˆŒ
ð Ÿ*™*˜ˆŒà�‰�dÔØ�‰�cÕr   c                 ó’   • [         R                  " U5      U l        U R                  R	                  U R                  5        SU l        g rõ   )r8   ÚasarrayÚ_datarì  rî  r�   )r   rï  s     r   rî  ÚOffsetImage.set_data˜  s.   € Ü—Z’Z “_ˆŒ
Ø�
‰
×Ñ˜DŸJ™JÔ'Øˆ�
r   c                 ó   • U R                   $ r   )ró  r•   s    r   Úget_dataÚOffsetImage.get_data�  ó   € Ø�z‰zÐr   c                 ó   • Xl         SU l        g rõ   )Ú_zoomr�   )r   râ  s     r   rí  ÚOffsetImage.set_zoom   s   € ØŒ
Øˆ�
r   c                 ó   • U R                   $ r   )rú  r•   s    r   Úget_zoomÚOffsetImage.get_zoom¤  rø  r   c                 ó   • U R                   $ r!  r"  r•   s    r   r'   ÚOffsetImage.get_offset§  r$  r   c                 ó   • U R                   /$ r   )rì  r•   s    r   rn   ÚOffsetImage.get_children«  s   € Ø—
‘
ˆ|Ðr   c                 óö   • U R                   (       a  UR                  S5      OSnU R                  5       nU R                  5       nUR                  S S u  pVX&-  U-  X%-  U-  p‡[
        R                  " SSXx5      $ )NrË   r]  r   )rë  rÌ   rý  rö  Úshaper
   r!   )	r   r   r&  râ  ÚdataÚnyÚnxrB   ri  s	            r   rž   ÚOffsetImage.get_bbox®  sk   € Ø37·=·=�(×+Ñ+¨BÔ/ÀbˆØ�}‰}‹ˆØ�}‰}‹ˆØ—‘˜B˜Q�‰ˆØ‰|˜dÑ" G¡L°4Ñ$7ˆ1Ü×Ò  1 aÓ+Ð+r   c                 óH   • U R                   R                  U5        SU l        g rò   )rì  r´   r�   rš   s     r   r´   ÚOffsetImage.draw¶  s   € à�
‰
�‰˜Ô!àˆ�
r   )rh   ró  rë  rú  rì  r�   )rº   r»   r¼   r½   re   rî  rö  rí  rý  r'   rn   rž   r´   rÀ   rÁ   rÂ   s   @r   rá  rá  v  sX   ø† ð ØØØ#ØØ ØØØ÷ð ò@ò
òòòòò,÷ð r   rá  c            
       ó  • \ rS rSrSrSrS r\R                  SSSSSSSSS	.S
 jj5       r	\
S 5       r\R                  S 5       r\
S 5       r\R                  S 5       rS rS rS rSS jrS rSS jrSS jrS rS rSrg)ÚAnnotationBboxi½  zÒ
Container for an `OffsetBox` referring to a specific position *xy*.

Optionally an arrow pointing from the offsetbox to *xy* can be drawn.

This is like `.Annotation`, but with `OffsetBox` instead of `.Text`.
rŽ  c                 óL   • SU R                   S   S SU R                   S   S S3$ )NzAnnotationBbox(r   ÚgÚ,r6   Ú))rƒ   r•   s    r   Ú__str__ÚAnnotationBbox.__str__È  s+   € Ø  §¡¨¡¨A ¨a°·±¸±
¸1¨~¸QÐ?Ð?r   NTr•  ©rZ   rZ   )r˜  r¯   Úannotation_clipÚbox_alignmentÚ	bboxpropsÚ
arrowpropsrú   c                ó¬  • [         R                  R                  U 5        [        R                  R                  XXHS9  Xl        Ub  UR                  5       OSU l        U R                  U5        Ub  UOUU l	        Ub  UOUU l
        X�l        Ub<  U R                  R                  SS5      U l        [        S0 U R                  D6U l        OSU l        SU l        [!        SSSSSU R"                  R%                  5       S	US
9U l        U R&                  R)                  SUS9  U
(       a  U R&                  R*                  " S0 U
D6  U R-                  U5        g)az	  
Parameters
----------
offsetbox : `OffsetBox`

xy : (float, float)
    The point *(x, y)* to annotate. The coordinate system is determined
    by *xycoords*.

xybox : (float, float), default: *xy*
    The position *(x, y)* to place the text at. The coordinate system
    is determined by *boxcoords*.

xycoords : single or two-tuple of str or `.Artist` or `.Transform` or callable, default: 'data'
    The coordinate system that *xy* is given in. See the parameter
    *xycoords* in `.Annotation` for a detailed description.

boxcoords : single or two-tuple of str or `.Artist` or `.Transform` or callable, default: value of *xycoords*
    The coordinate system that *xybox* is given in. See the parameter
    *textcoords* in `.Annotation` for a detailed description.

frameon : bool, default: True
    By default, the text is surrounded by a white `.FancyBboxPatch`
    (accessible as the ``patch`` attribute of the `.AnnotationBbox`).
    If *frameon* is set to False, this patch is made invisible.

annotation_clip: bool or None, default: None
    Whether to clip (i.e. not draw) the annotation when the annotation
    point *xy* is outside the Axes area.

    - If *True*, the annotation will be clipped when *xy* is outside
      the Axes.
    - If *False*, the annotation will always be drawn.
    - If *None*, the annotation will be clipped when *xy* is outside
      the Axes and *xycoords* is 'data'.

pad : float, default: 0.4
    Padding around the offsetbox.

box_alignment : (float, float)
    A tuple of two floats for a vertical and horizontal alignment of
    the offset box w.r.t. the *boxcoords*.
    The lower-left corner is (0, 0) and upper-right corner is (1, 1).

bboxprops : dict, optional
    A dictionary of properties to set for the annotation bounding box,
    for example *boxstyle* and *alpha*.  See `.FancyBboxPatch` for
    details.

arrowprops: dict, optional
    Arrow properties, see `.Annotation` for description.

fontsize: float or str, optional
    Translated to points and passed as *mutation_scale* into
    `.FancyBboxPatch` to scale attributes of the box style (e.g. pad
    or rounding_size).  The name is chosen in analogy to `.Text` where
    *fontsize* defines the mutation scale as well.  If not given,
    :rc:`legend.fontsize` is used.  See `.Text.set_fontsize` for valid
    values.

**kwargs
    Other `AnnotationBbox` properties.  See `.AnnotationBbox.set` for
    a list.
)Úxycoordsr  NÚrelposr  rá   rË   rB   râ   T)rƒ   r   r   rå   ræ   rç   rè   ré   Úsquarer®   )rc   )r6   r6   rP   )rs   rt   re   r>  Ú_AnnotationBaseÚ	offsetboxÚcopyr  Úset_fontsizeÚxyboxÚ	boxcoordsÚ_box_alignmentÚpopÚ_arrow_relposr   Úarrow_patchr   r—  r¨  rë   Úset_boxstylerÚ  rf   )r   r  rƒ   r   r  r!  r˜  r¯   r  r  r  r  rú   r#   s                 r   re   ÚAnnotationBbox.__init__Ë  s9  € ôX 	�‰×Ñ Ô%Ü×Ñ×&Ñ&Ø˜xð 	'ñ 	Jð #ŒØ/9Ñ/E˜*Ÿ/™/Ô+È4ˆŒØ×Ñ˜(Ô#Ø#Ñ/‘U°RˆŒ
Ø&/Ñ&;™ÀˆŒØ+ÔàÑ!Ø!%§¡×!4Ñ!4°X¸zÓ!JˆDÔÜ.ñ  BØ15·±ñ BˆDÕð "&ˆDÔØ#ˆDÔä#Ø ¨BØ SØŸ9™9×7Ñ7Ó9ØØñ
ˆŒ
ð 	�
‰
×Ñ ¨cÐÑ2ÞØ�J‰J�NŠNÑ'˜YÒ'à×Ñ˜fÕ%r   c                 ó   • U R                   $ r   )r   r•   s    r   ÚxyannÚAnnotationBbox.xyann7  s   € à�z‰zÐr   c                 ó   • Xl         SU l        g rõ   )r   r�   )r   r)  s     r   r)  r*  ;  s   € àŒ
Øˆ�
r   c                 ó   • U R                   $ r   )r!  r•   s    r   Ú	anncoordsÚAnnotationBbox.anncoords@  r—   r   c                 ó   • Xl         SU l        g rõ   )r!  r�   )r   Úcoordss     r   r-  r.  D  s   € àŒØˆ�
r   c                 ó    • U R                  U5      (       a  S0 4$ U R                  S 5      (       d  S0 4$ U R                  R                  U5      $ rò   )rz   Ú	_check_xyr  r{   )r   r|   s     r   r{   ÚAnnotationBbox.containsI  sK   € Ø×!Ñ! *×-Ñ-Ø˜"�9ÐØ�~‰~˜d×#Ñ#Ø˜"�9ÐØ�~‰~×&Ñ& zÓ2Ð2r   c                 óŽ   • U R                   U R                  /nU R                  (       a  UR                  U R                  5        U$ r   )r  rë   r%  r*  )r   rÆ   s     r   rn   ÚAnnotationBbox.get_childrenQ  s4   € Ø—N‘N D§J¡JÐ/ˆØ××Ø�O‰O˜D×,Ñ,Ô-Øˆr   c                 óÈ   • U R                   b  U R                   R                  U5        U R                  R                  U5        [        R                  R                  X5        g r   )r%  rm   r  rs   rt   )r   ro   s     r   rm   ÚAnnotationBbox.set_figureW  sF   € Ø×ÑÑ'Ø×Ñ×'Ñ'¨Ô,Ø�‰×!Ñ! #Ô&Ü�‰×!Ñ! $Õ,r   c                 óZ   • Uc  [         R                  S   n[        US9U l        SU l        g)zS
Set the fontsize in points.

If *s* is not given, reset to :rc:`legend.fontsize`.
Nr�  rž  T)r¤  r¥  r   r—  r�   rG  s     r   r  ÚAnnotationBbox.set_fontsize]  s+   € ð ‰9Ü—‘Ð.Ñ/ˆAä"¨Ñ*ˆŒ	Øˆ�
r   c                 ó6   • U R                   R                  5       $ )zReturn the fontsize in points.)r—  r¨  r•   s    r   Úget_fontsizeÚAnnotationBbox.get_fontsizei  s   € à�y‰y×+Ñ+Ó-Ð-r   c                 óö   • Uc  U R                  SS9R                  5       nU R                  U5        [        R                  " U R                  5        Vs/ s H  nUR                  U5      PM     sn5      $ s  snf r¡   )r¤   r¥   Úupdate_positionsr
   r„  rn   rª   ©r   r   rí   s      r   rª   Ú AnnotationBbox.get_window_extentm  st   € àÑØ—‘¨D�Ð1×?Ñ?ÓAˆHØ×Ñ˜hÔ'Ü�zŠzØ(,×(9Ñ(9Ô(;ó=Ú(;˜uð !×2Ñ2°8Ö<Ù(;ñ=ó >ð 	>ùò =ó   ÁA6c                 óö   • Uc  U R                  SS9R                  5       nU R                  U5        [        R                  " U R                  5        Vs/ s H  nUR                  U5      PM     sn5      $ s  snf r¡   )r¤   r¥   r>  r
   r„  rn   Úget_tightbboxr?  s      r   rC  ÚAnnotationBbox.get_tightbboxu  st   € àÑØ—‘¨D�Ð1×?Ñ?ÓAˆHØ×Ñ˜hÔ'Ü�zŠzØ(,×(9Ñ(9Ô(;ó=Ú(;˜uð !×.Ñ.¨xÖ8Ù(;ñ=ó >ð 	>ùò =rA  c                 ó   • U R                  XR                  U R                  5      u  p#U R                  R	                  U5      nU R
                  u  pVU R                  R                  X%UR                  -  -
  UR                  -
  X6UR                  -  -
  UR                  -
  45        U R                  R                  U5      nU R                  R                  UR                  5        UR                  U R!                  5       5      nU R                  R#                  U5        U R$                  (       aÝ  UR&                  UR(                  U R*                  -  -   nU R-                  U5      n	U R.                  R1                  X‰5        SU R$                  ;   a  UR                  U R$                  S   5      nU R.                  R#                  U5        U R$                  R3                  SU R                  5      n
U R.                  R5                  U
5        gg)zHUpdate pixel positions for the annotated point, the text, and the arrow.rç   ÚpatchAN)Ú_get_xyr   r!  r  rž   r"  r„   r   rˆ   r   rS   rª   rë   rö   r÷   rÌ   r;  rø   r  rÓ  rb  r$  Ú_get_position_xyr%  Úset_positionsÚgetÚ
set_patchA)r   r   Úox0Úoy0r   ÚfwÚfhrç   Úarrow_beginÚ	arrow_endrF  s              r   r>  ÚAnnotationBbox.update_positions}  s—  € ð —<‘< ¯*©*°d·n±nÓE‰ˆØ�~‰~×&Ñ& xÓ0ˆØ×$Ñ$‰ˆØ�‰×!Ñ!Ø�d—j‘j‘=Ñ  4§7¡7Ñ*¨C°T·[±[±.Ñ,@À4Ç7Á7Ñ,JÐKô	Mð �~‰~×/Ñ/°Ó9ˆØ�
‰
×Ñ˜dŸk™kÔ*à!×2Ñ2°4×3DÑ3DÓ3FÓGˆØ�
‰
×%Ñ% nÔ5à�?�?ð
 Ÿ'™' D§I¡I°×0BÑ0BÑ$BÑBˆKØ×-Ñ-¨hÓ7ˆIð ×Ñ×*Ñ*¨;ÔBà 4§?¡?Ó2Ø!)×!:Ñ!:Ø—O‘OÐ$4Ñ5ó"7�ð ×Ñ×/Ñ/°Ô?à—_‘_×(Ñ(¨°4·:±:Ó>ˆFØ×Ñ×'Ñ'¨Õ/ð' r   c                 ó„  • U R                  5       (       a  U R                  U5      (       d  g UR                  U R                  R                  U R                  5       S9  U R                  U5        U R                  bb  U R                  R                  SS9c-  U R                  SS9=nb  U R                  R                  U5        U R                  R                  U5        U R                  R                  U5        U R                  R                  U5        UR                  U R                  R                  5        SU l        g )N)ÚgidFr¢   )r‘   r2  Ú
open_grouprj   rº   Úget_gidr>  r%  r¤   rm   r´   rë   r  Úclose_groupr�   )r   r   ro   s      r   r´   ÚAnnotationBbox.draw¡  sø   € à×Ñ×!Ñ!¨¯©¸×)AÑ)AØØ×Ñ˜DŸN™N×3Ñ3¸¿¹»ÐÑHØ×Ñ˜hÔ'Ø×ÑÑ'Ø× Ñ ×+Ñ+°Ð+Ð7Ñ?Ø ŸO™O°˜OÐ7Ð7�SÑDØ× Ñ ×+Ñ+¨CÔ0Ø×Ñ×!Ñ! (Ô+Ø�
‰
�‰˜Ô!Ø�‰×Ñ˜HÔ%Ø×Ñ˜TŸ^™^×4Ñ4Ô5Øˆ�
r   )
r$  r"  r%  r  r!  r  rë   r—  r�   r   )Nr  Nr   )rº   r»   r¼   r½   r¾   rÆ  r  r   Úinterpdre   r8  r)  r¿   r-  r{   rn   rm   r  r;  rª   rC  r>  r´   rÀ   rP   r   r   r  r  ½  sÓ   † ñð €Fò@ð ×Ñði&Ø 3Ø!%Ø)ØØ Øõi&ó ði&ðV ñó ðð ‡\�\ñó ðð ñó ðð ×Ññó ðò3òò-ô
ò.ô>ô>ò"0õHr   r  c                   ó†   • \ rS rSrSrSS jr\S 5       r\" S 5      r	\" S 5      r
S rS rS	 rS
 rS rS rS rS rSrg)ÚDraggableBasei²  aG  
Helper base class for a draggable artist (legend, offsetbox).

Derived classes must override the following methods::

    def save_offset(self):
        '''
        Called when the object is picked for dragging; should save the
        reference position of the artist.
        '''

    def update_offset(self, dx, dy):
        '''
        Called during the dragging; (*dx*, *dy*) is the pixel offset from
        the point where the mouse drag started.
        '''

Optionally, you may override the following method::

    def finalize_offset(self):
        '''Called when the mouse is released.'''

In the current implementation of `.DraggableLegend` and
`DraggableAnnotation`, `update_offset` places the artists in display
coordinates, and `finalize_offset` recalculates their position in axes
coordinate and set a relevant attribute.
c                 óà  • Xl         UR                  5       (       d  UR                  U R                  5        SU l        U=(       a    U R
                  R                  U l        U R
                  R                  nSU R                  4SU R                  4SU R                  44 VVs/ s H5  u  pE[        R                  " UR                  UR                  XE5      5      PM7     snnU l        g s  snnf )NFÚ
pick_eventÚbutton_release_eventÚmotion_notify_event)Ú
ref_artistÚpickableÚ
set_pickerÚ_pickerÚ
got_artistÚcanvasÚsupports_blitÚ	_use_blitÚ	callbacksÚon_pickÚ
on_releaseÚ	on_motionr)   ÚpartialÚ
disconnectÚ_connect_picklableÚ_disconnectors)r   r`  Úuse_blitrh  ÚnameÚfuncs         r   re   ÚDraggableBase.__init__Ï  sÉ   € Ø$ŒØ×"Ñ"×$Ñ$Ø×!Ñ! $§,¡,Ô/ØˆŒØ!×? d§k¡k×&?Ñ&?ˆŒØ—K‘K×)Ñ)ˆ	ð
 ˜tŸ|™|Ð,Ø'¨¯©Ð9Ø&¨¯©Ð7ñô
ò‘
�ô ×ÒØ×$Ñ$ i×&BÑ&BÀ4Ó&NöPñò
ˆÕùó 
s   Â$<C*c                 óL   • UR                   S:X  a  S0 4$ U R                  U5      $ )NÚscroll_eventF)rq  r{   )Úartistr|   s     r   rc  ÚDraggableBase._pickerà  s)   € ð �?‰?˜nÓ,Ø˜"�9ÐØ�‰˜zÓ*Ð*r   c                 óH   • U R                   R                  SS9R                  $ r¡   )r`  r¤   re  r•   s    r   r   ÚDraggableBase.<lambda>è  s   €  4§?¡?×#=Ñ#=À4Ð#=Ð#H×#OÒ#Or   c                 ód   • U R                   S S  Vs/ s H  oR                  S   PM     sn$ s  snf )Nr]  r   )ro  r"   )r   rm  s     r   r   ry  é  s6   € Ø-1×-@Ñ-@ÀÀ!Ñ-Dó"FÚ-D˜z�‰˜ÔÑ-Dò"Fùò "Fs   ’-c                 ó2  • U R                  5       (       Ga  U R                  (       aï  UR                  U R                  -
  nUR                  U R
                  -
  nU R                  X#5        U R                  (       a€  U R                  R                  U R                  5        U R                  R                  U R                  R                  SS9R                  5       5        U R                  R                  5         g U R                  R                  5         g g g r¡   )Ú_check_still_parentedrd  ÚxÚmouse_xÚyÚmouse_yÚupdate_offsetrg  re  Úrestore_regionÚ
backgroundr`  r´   r¤   r¥   Úblit)r   ÚevtÚdxÚdys       r   rk  ÚDraggableBase.on_motionì  s¿   € Ø×%Ñ%×'Ò'¨D¯O¯OØ—‘˜Ÿ™Ñ%ˆBØ—‘˜Ÿ™Ñ%ˆBØ×Ñ˜rÔ&Ø�~�~Ø—‘×*Ñ*¨4¯?©?Ô;Ø—‘×$Ñ$Ø—O‘O×.Ñ.°DÐ.Ð9×GÑGÓIôKà—‘× Ñ Õ"à—‘× Ñ Õ"ð -<Ð'r   c                 ó¾  • U R                  5       (       GaG  UR                  U R                  :X  aM  UR                  R                  U l        UR                  R                  U l        U R                  5         SU l	        U R                  (       aÎ  U R                  (       a¼  U R                  R                  S5        U R                  R                  5         U R                  R                  SS9nU R                  R                  UR                   5      U l        U R                  R                  UR%                  5       5        U R                  R'                  5         g g g g )NTFr¢   )r|  rv  r`  r|   r}  r~  r  r€  Úsave_offsetrd  rg  Úset_animatedre  r´   r¤   Úcopy_from_bboxr   rƒ  r¥   r„  )r   r…  ro   s      r   ri  ÚDraggableBase.on_pickù  sí   € Ø×%Ñ%×'Ò'Ø�z‰z˜TŸ_™_Ó,Ø"Ÿ~™~×/Ñ/�”Ø"Ÿ~™~×/Ñ/�”Ø× Ñ Ô"Ø"&�”Ø�� 4§>§>Ø—‘×,Ñ,¨TÔ2Ø—‘× Ñ Ô"Ø—o‘o×0Ñ0°eÐ0Ð<�Ø"&§+¡+×"<Ñ"<¸S¿X¹XÓ"F�”Ø—‘×$Ñ$ S×%6Ñ%6Ó%8Ô9Ø—‘× Ñ Õ"ð $2ˆð (r   c                 óÔ  • U R                  5       (       aÓ  U R                  (       aÁ  U R                  5         SU l        U R                  (       a˜  U R                  R                  U R                  5        U R                  R                  U R                  R                  R                  5       5        U R                  R                  5         U R                  R                  S5        g g g g rò   )r|  rd  Úfinalize_offsetrg  re  r‚  rƒ  r`  r´   Úfigurer¥   r„  r‹  )r   Úevents     r   rj  ÚDraggableBase.on_release  s›   € Ø×%Ñ%×'Ñ'¨D¯O¯OØ× Ñ Ô"Ø#ˆDŒOØ�~�~Ø—‘×*Ñ*¨4¯?©?Ô;Ø—‘×$Ñ$ T§_¡_×%;Ñ%;×%IÑ%IÓ%KÔLØ—‘× Ñ Ô"Ø—‘×,Ñ,¨UÕ3ð	 ð -<Ð'r   c                 óZ   • U R                   R                  SS9c  U R                  5         gg)NFr¢   T)r`  r¤   rm  r•   s    r   r|  Ú#DraggableBase._check_still_parented  s*   € Ø�?‰?×%Ñ%¨5Ð%Ð1Ñ9Ø�O‰OÔØàr   c                 ó8   • U R                    H
  nU" 5         M     g)zDisconnect the callbacks.N)ro  )r   Údisconnectors     r   rm  ÚDraggableBase.disconnect  s   € à ×/Ô/ˆLÙŽNò 0r   c                 ó   • g r   rP   r•   s    r   rŠ  ÚDraggableBase.save_offset  ó   € Ør   c                 ó   • g r   rP   )r   r†  r‡  s      r   r�  ÚDraggableBase.update_offset!  rš  r   c                 ó   • g r   rP   r•   s    r   r�  ÚDraggableBase.finalize_offset$  rš  r   )ro  rg  rƒ  rd  r~  r€  r`  N©F)rº   r»   r¼   r½   r¾   re   Ústaticmethodrc  r8  re  Úcidsrk  ri  rj  r|  rm  rŠ  r�  r�  rÀ   rP   r   r   r[  r[  ²  sf   † ñô8
ð" ñ+ó ð+ñ ÑOÓP€FÙñ Fó G€Dò#ò#ò4òòò
òõr   r[  c                   ó>   ^ • \ rS rSrSU 4S jjrS rS rS rSrU =r	$ )ÚDraggableOffsetBoxi(  c                 ó,   >• [         TU ]  XS9  X l        g ©N)rp  )rd   re   r  )r   r`  r  rp  rj   s       €r   re   ÚDraggableOffsetBox.__init__)  s   ø€ Ü‰Ñ˜ÐÑ7Ø"�r   c                 óì   • U R                   nUR                  SS9R                  5       nUR                  UR	                  U5      U5      nUu  U l        U l        U R                   R                  U5        g r¡   )r  r¤   r¥   r'   rž   Úoffsetbox_xÚoffsetbox_yr„   )r   r  r   Úoffsets       r   rŠ  ÚDraggableOffsetBox.save_offset-  sf   € Ø—N‘Nˆ	Ø×'Ñ'¨TÐ'Ð2×@Ñ@ÓBˆØ×%Ñ% i×&8Ñ&8¸Ó&BÀHÓMˆØ-3Ñ*ˆÔ˜$Ô*Ø�‰×!Ñ! &Õ)r   c                 óv   • U R                   U-   U R                  U-   4nU R                  R                  U5        g r   )r¨  r©  r  r„   )r   r†  r‡  Úloc_in_canvass       r   r�  Ú DraggableOffsetBox.update_offset4  s4   € Ø×(Ñ(¨2Ñ-¨t×/?Ñ/?À"Ñ/DÐDˆØ�‰×!Ñ! -Õ0r   c                 óÎ   • U R                   nUR                  SS9R                  5       nUR                  U5      nUR                  u  pEXCR
                  -   XSR                  -   4nU$ r¡   )r  r¤   r¥   rž   ri   rˆ   rS   )r   r  r   r   r·   r¸   r­  s          r   Úget_loc_in_canvasÚ$DraggableOffsetBox.get_loc_in_canvas8  s`   € Ø—N‘Nˆ	Ø×'Ñ'¨TÐ'Ð2×@Ñ@ÓBˆØ×!Ñ! (Ó+ˆØ×"Ñ"‰ˆØŸg™g™ r¯G©G¡|Ð4ˆØÐr   )r  r¨  r©  rŸ  )
rº   r»   r¼   r½   re   rŠ  r�  r°  rÀ   rÁ   rÂ   s   @r   r£  r£  (  s   ø† ÷#ò*ò1÷ð r   r£  c                   ó8   ^ • \ rS rSrSU 4S jjrS rS rSrU =r$ )ÚDraggableAnnotationiA  c                 ó,   >• [         TU ]  XS9  Xl        g r¥  )rd   re   Ú
annotation)r   rµ  rp  rj   s      €r   re   ÚDraggableAnnotation.__init__B  s   ø€ Ü‰Ñ˜ÐÑ7Ø$�r   c                 óˆ   • U R                   nUR                  5       R                  UR                  5      u  U l        U l        g r   )rµ  r  r¸  r)  r·   r¸   )r   Úanns     r   rŠ  ÚDraggableAnnotation.save_offsetF  s1   € Ø�o‰oˆØ×,Ñ,Ó.×8Ñ8¸¿¹ÓCÑˆŒ�•r   c                 ó¸   • U R                   nUR                  5       R                  5       R                  U R                  U-   U R
                  U-   45      Ul        g r   )rµ  r  Úinvertedr¸  r·   r¸   r)  )r   r†  r‡  r¸  s       r   r�  Ú!DraggableAnnotation.update_offsetJ  sG   € Ø�o‰oˆØ×%Ñ%Ó'×0Ñ0Ó2×<Ñ<Ø�W‰W�r‰\˜4Ÿ7™7 R™<Ð(ó*ˆ�	r   )rµ  r·   r¸   rŸ  )	rº   r»   r¼   r½   re   rŠ  r�  rÀ   rÁ   rÂ   s   @r   r³  r³  A  s   ø† ÷%òD÷*ð *r   r³  )r1   )rH   )7r¾   r)   Únumpyr8   Ú
matplotlibr¤  r   r   Úmatplotlib.artistrv  rs   Úmatplotlib.pathÚpathr1  Úmatplotlib.textÚtextr>  Úmatplotlib.transformsÚ
transformsr  Úmatplotlib.font_managerr   Úmatplotlib.imager   Úmatplotlib.patchesr   r   r	   r.   r
   r   r   r-   r+   r/   rF   r^   rt   r`   rÄ   rÉ   rØ   rÝ   r   r:  rr  rŒ  rÀ  rÖ  rá  r  r  r[  r£  r³  rP   r   r   Ú<module>rÉ     sA  ðñó0 ã ã ß 'Ý #Ý Ý Ý +Ý 2Ý &÷Bñ Bç AÑ Að 	€òò(&ô
Nôb0ôfw�—‘ô wôt,"�ô ,"ô^%(ˆjô %(ôP,ˆjô ,ôDU"�	ô U"ôpm�)ô mô`sˆyô sôlM�iô Mô`q˜	ô qòh	4ô(Ð$ô (ôVD�)ô DôNr�W—^‘^ U×%:Ñ%:ô r÷jsñ sôl˜ô ô2*˜-õ *r   