
    h~             	       j   S r SSKrSSKrSSKrSSKJrJr  SSKrSSKJ	r	  SSK
Jr  SSKJr  SSKrSSKrSSKJrJrJrJrJrJrJrJr  SS	KJrJrJ r J!r!J"r"J#r#J$r$J%r%  SS
K&J'r'  SSK(J)r)J*r*  \RV                  \RX                  " S/S/S/S/S/S.5       " S S\RZ                  5      5       5       r. " S S\.5      r/ " S S\.5      r0 " S S\.5      r1 " S S\.5      r2 " S S\25      r3 " S S\.5      r4 " S  S!\.5      r5 " S" S#\.5      r6 " S$ S%\45      r7\RV                  Rq                  S&Rs                  \Rt                  " \7Rv                  5      =(       d    S'Ry                  5       S(S 5      S)9   " S* S+\15      r= " S, S-\.5      r> " S. S/\.5      r? " S0 S1\>5      r@ " S2 S3\>5      rASGS4 jrBSHS5 jrC " S6 S75      rDSISS8.S9 jjrE\RV                   " S: S;\D5      5       rF\RV                   " S< S=\D5      5       rGS> rH\RV                   " S? S@\D5      5       rI " SA SB\.5      rJ " SC SD\.5      rK " SE SF\K5      rLg)Jz>
Patches are `.Artist`\s with a face color and an edge color.
    N)NumberReal)SimpleNamespace)
namedtuple)Affine2D   )_apiartistcbookcolors
_docstringhatchlines
transforms)NonIntersectingPathExceptionget_cos_singet_intersectionget_parallelsinside_circlemake_wedged_bezier2)split_bezier_intersecting_with_closedpathsplit_path_inout)Path)	JoinStyleCapStyleaaecfclslw)antialiased	edgecolor	facecolor	linestyle	linewidthc                     ^  \ rS rSrSrSrSrSSSSSSSSSSS.
U 4S jjrS	 rS
 r	S1S jr
S1S jrS1S jrU 4S jrS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rU 4S jrS rS  rS! r S" r!\"" \!\ 5      r#\$RJ                  S# 5       r&S$ r'\$RJ                  S% 5       r(S& r)S' r*S( r+S) r,S* r-S+ r.\/R`                  S, 5       r1S- r2S1S. jr3S/ r4S0r5U =r6$ )2Patch   z
A patch is a 2D artist with a face color and an edge color.

If any of *edgecolor*, *facecolor*, *linewidth*, or *antialiased*
are *None*, they default to their rc params setting.
r   FNT)
r"   r#   colorr%   r$   r!   r   fillcapstyle	joinstylec       
            > [         TU ]  5         Uc  SnU	c  [        R                  n	U
c  [        R
                  n
[        R                  " [        R                  S   5      U l
        [        R                  S   U l        [        U5      U l        Ub.  Uc  Ub  [        R                  " S5        U R!                  U5        O"U R#                  U5        U R%                  U5        SU l        SU l        SU l        U R-                  U5        U R/                  U5        U R1                  U5        U R3                  U5        U R5                  U	5        U R7                  U
5        [9        U5      (       a  U R;                  U5        gg)z?
The following kwarg properties are supported

%(Patch:kwdoc)s
Nsolidzhatch.colorzhatch.linewidthzQSetting the 'color' property will override the edgecolor or facecolor properties.r   )r   N)super__init__r   buttr   miterr   to_rgbamplrcParams_hatch_color_hatch_linewidthbool_fillr	   warn_external	set_colorset_edgecolorset_facecolor
_linewidth_unscaled_dash_pattern_dash_patternset_linestyleset_linewidthset_antialiased	set_hatchset_capstyleset_joinstylelen_internal_update)selfr"   r#   r)   r%   r$   r!   r   r*   r+   r,   kwargs	__class__s               D/var/www/html/env/lib/python3.13/site-packages/matplotlib/patches.pyr0   Patch.__init__0   sC   " 	I}}H!I"NN3<<+FG #-> ?$Z
$	(=""=> NN5!y)y)&/#&9%9%[)u(#9%v;;!!&)     c                     U R                  5       nU R                  5       nUR                  U5      n[        U5      (       a  US   $ / $ )u   
Return a copy of the vertices used in this patch.

If the patch contains Bézier curves, the curves will be interpolated by
line segments.  To access the curves as curves, use `get_path`.
r   )get_transformget_pathto_polygonsrG   )rI   transpathpolygonss       rL   	get_vertsPatch.get_vertse   sE     ""$}}##E*x==A;	rN   c                     Ub  U$ [        U R                  [        5      (       a  U R                  nU$ U R                  5       S   S:X  a  SnU$ U R	                  5       nU$ )N   r   )
isinstance_pickerr   get_edgecolorget_linewidth)rI   radius_radiuss      rL   _process_radiusPatch._process_radiuss   sg    MdllF++llG 	 !!#A&!+  ,,.rN   c                   ^ ^^ T R                  T5      (       a  S0 4$ T R                  T5      mT R                  5       R                  nUb  T R                  5       R                  n[
        R                  " U[        R                  :H  5      u  nUSS n[        [        [
        R                  " XE5      [
        R                  " X55      5      nOT R                  5       /n[        UUU 4S jU 5       5      nU0 4$ )a  
Test whether the mouse event occurred in the patch.

Parameters
----------
mouseevent : `~matplotlib.backend_bases.MouseEvent`
    Where the user clicked.

radius : float, optional
    Additional margin on the patch in target coordinates of
    `.Patch.get_transform`. See `.Path.contains_point` for further
    details.

    If `None`, the default value depends on the state of the object:

    - If `.Artist.get_picker` is a number, the default
      is that value.  This is so that picking works as expected.
    - Otherwise if the edge color has a non-zero alpha, the default
      is half of the linewidth.  This is so that all the colored
      pixels are "in" the patch.
    - Finally, if the edge has 0 alpha, the default is 0.  This is
      so that patches without a stroked edge do not have points
      outside of the filled region report as "in" due to an
      invisible edge.


Returns
-------
(bool, empty dict)
FNr   c              3      >#    U  H<  nUR                  TR                  TR                  4TR                  5       T5      v   M>     g 7fN)contains_pointxyrP   ).0subpath
mouseeventr^   rI   s     rL   	<genexpr>!Patch.contains.<locals>.<genexpr>   sI      % $ ""z||,d.@.@.BFL L#s   AA)_different_canvasr`   rQ   codesverticesnpwherer   MOVETOmapsplitany)rI   rj   r^   rn   ro   idxssubpathsinsides   ```     rL   containsPatch.contains   s    > !!*--"9%%f-%%}}//H HHUdkk12ED8Dbhhx.0EGH (H % $% % rzrN   c                     U R                  U5      nU R                  5       R                  UU R                  5       U5      $ )ah  
Return whether the given point is inside the patch.

Parameters
----------
point : (float, float)
    The point (x, y) to check, in target coordinates of
    ``.Patch.get_transform()``. These are display coordinates for patches
    that are added to a figure or Axes.
radius : float, optional
    Additional margin on the patch in target coordinates of
    `.Patch.get_transform`. See `.Path.contains_point` for further
    details.

    If `None`, the default value depends on the state of the object:

    - If `.Artist.get_picker` is a number, the default
      is that value.  This is so that picking works as expected.
    - Otherwise if the edge color has a non-zero alpha, the default
      is half of the linewidth.  This is so that all the colored
      pixels are "in" the patch.
    - Finally, if the edge has 0 alpha, the default is 0.  This is
      so that patches without a stroked edge do not have points
      outside of the filled region report as "in" due to an
      invisible edge.

Returns
-------
bool

Notes
-----
The proper use of this method depends on the transform of the patch.
Isolated patches do not have a transform. In this case, the patch
creation coordinates and the point coordinates match. The following
example checks that the center of a circle is within the circle

>>> center = 0, 0
>>> c = Circle(center, radius=1)
>>> c.contains_point(center)
True

The convention of checking against the transformed patch stems from
the fact that this method is predominantly used to check if display
coordinates (e.g. from mouse events) are within the patch. If you want
to do the above check with data coordinates, you have to properly
transform them first:

>>> center = 0, 0
>>> c = Circle(center, radius=3)
>>> plt.gca().add_patch(c)
>>> transformed_interior_point = c.get_data_transform().transform((0, 2))
>>> c.contains_point(transformed_interior_point)
True

)r`   rQ   re   rP   )rI   pointr^   s      rL   re   Patch.contains_point   s?    r %%f-}}--e.2.@.@.B.46 	6rN   c                     U R                  U5      nU R                  5       R                  UU R                  5       U5      $ )a  
Return whether the given points are inside the patch.

Parameters
----------
points : (N, 2) array
    The points to check, in target coordinates of
    ``self.get_transform()``. These are display coordinates for patches
    that are added to a figure or Axes. Columns contain x and y values.
radius : float, optional
    Additional margin on the patch in target coordinates of
    `.Patch.get_transform`. See `.Path.contains_point` for further
    details.

    If `None`, the default value depends on the state of the object:

    - If `.Artist.get_picker` is a number, the default
      is that value.  This is so that picking works as expected.
    - Otherwise if the edge color has a non-zero alpha, the default
      is half of the linewidth.  This is so that all the colored
      pixels are "in" the patch.
    - Finally, if the edge has 0 alpha, the default is 0.  This is
      so that patches without a stroked edge do not have points
      outside of the filled region report as "in" due to an
      invisible edge.

Returns
-------
length-N bool array

Notes
-----
The proper use of this method depends on the transform of the patch.
See the notes on `.Patch.contains_point`.
)r`   rQ   contains_pointsrP   )rI   pointsr^   s      rL   r   Patch.contains_points   s?    H %%f-}}..v/3/A/A/C/57 	7rN   c                   > [         TU ]  U5        UR                  U l        UR                  U l        UR                  U l        UR
                  U l        UR                  U l        UR                  U l        UR                  U l        UR                  U l	        U R                  UR                  5        U R                  UR                  5       5        UR                  5       U l        g rd   )r/   update_from
_edgecolor
_facecolor_original_edgecolor_original_facecolorr9   _hatchr6   r?   rB   r>   set_transformget_data_transformis_transform_set_transformSet)rI   otherrK   s     rL   r   Patch.update_from  s    E"  ****#(#<#< #(#<#< [[
ll!..&+&B&B#5++,53356 #335rN   c                 \    U R                  5       R                  U R                  5       5      $ )zE
Return the `Patch`'s axis-aligned extents as a `~.transforms.Bbox`.
rQ   get_extentsrP   rI   s    rL   r   Patch.get_extents-  s$     }}**4+=+=+?@@rN   c                 b    U R                  5       [        R                  R                  U 5      -   $ )z;Return the `~.transforms.Transform` applied to the `Patch`.)get_patch_transformr
   ArtistrP   r   s    rL   rP   Patch.get_transform3  s%    '')FMM,G,G,MMMrN   c                 @    [         R                  R                  U 5      $ )zW
Return the `~.transforms.Transform` mapping data coordinates to
physical coordinates.
)r
   r   rP   r   s    rL   r   Patch.get_data_transform7  s    
 }}**400rN   c                 ,    [         R                  " 5       $ )a#  
Return the `~.transforms.Transform` instance mapping patch coordinates
to data coordinates.

For example, one may define a patch of a circle which represents a
radius of 5 by providing coordinates for a unit circle, and a
transform which scales the coordinates (the patch coordinate) by 5.
)r   IdentityTransformr   s    rL   r   Patch.get_patch_transform>  s     ++--rN   c                     U R                   $ )z0Return whether antialiasing is used for drawing.)_antialiasedr   s    rL   get_antialiasedPatch.get_antialiasedI  s       rN   c                     U R                   $ )zReturn the edge color.)r   r   s    rL   r\   Patch.get_edgecolorM      rN   c                     U R                   $ )zReturn the face color.)r   r   s    rL   get_facecolorPatch.get_facecolorQ  r   rN   c                     U R                   $ )z Return the line width in points.)r>   r   s    rL   r]   Patch.get_linewidthU  r   rN   c                     U R                   $ )zReturn the linestyle.)
_linestyler   s    rL   get_linestylePatch.get_linestyleY  r   rN   c                 J    Uc  [         R                  S   nXl        SU l        g)zT
Set whether to use antialiased rendering.

Parameters
----------
aa : bool or None
Nzpatch.antialiasedT)r4   r5   r   stale)rI   r   s     rL   rC   Patch.set_antialiased]  s%     :12B
rN   c                 :   SnUcR  [         R                  S   (       d"  U R                  (       a  U R                  (       a  [         R                  S   nOSnSn[        R
                  " XR                  5      U l        U(       a  U R                  U l        SU l	        g )NTzpatch.force_edgecolorzpatch.edgecolornoneF)
r4   r5   r9   _edge_defaultr   r3   _alphar   r6   r   )rI   r)   set_hatch_colors      rL   _set_edgecolorPatch._set_edgecolorj  sk    =45

d&8&8%67"' ..< $D
rN   c                 2    Xl         U R                  U5        g)zS
Set the patch edge color.

Parameters
----------
color : :mpltype:`color` or None
N)r   r   rI   r)   s     rL   r<   Patch.set_edgecolory       $) E"rN   c                     Uc  [         R                  S   nU R                  (       a  U R                  OSn[        R
                  " X5      U l        SU l        g )Nzpatch.facecolorr   T)r4   r5   r9   r   r   r3   r   r   )rI   r)   alphas      rL   _set_facecolorPatch._set_facecolor  s>    =LL!23E#zzq ..6
rN   c                 2    Xl         U R                  U5        g)zS
Set the patch face color.

Parameters
----------
color : :mpltype:`color` or None
N)r   r   r   s     rL   r=   Patch.set_facecolor  r   rN   c                 H    U R                  U5        U R                  U5        g)z
Set both the edgecolor and the facecolor.

Parameters
----------
c : :mpltype:`color`

See Also
--------
Patch.set_facecolor, Patch.set_edgecolor
    For setting the edge or face color individually.
N)r=   r<   )rI   cs     rL   r;   Patch.set_color  s      	11rN   c                    > [         TU ]  U5        U R                  U R                  5        U R	                  U R
                  5        g rd   )r/   	set_alphar   r   r   r   )rI   r   rK   s     rL   r   Patch.set_alpha  s8    % D445D445rN   c                     Uc  [         R                  S   n[        U5      U l        [        R
                  " / U R                  QUP76 U l        SU l        g)zM
Set the patch linewidth in points.

Parameters
----------
w : float or None
Nzpatch.linewidthT)	r4   r5   floatr>   mlines_scale_dashesr?   r@   r   rI   ws     rL   rB   Patch.set_linewidth  sS     9./A(#11 -((-*+-
rN   c                     Uc  SnUS;   a  SnXl         [        R                  " U5      U l        [        R                  " / U R                  QU R
                  P76 U l        SU l        g)a5  
Set the patch linestyle.

==========================================  =================
linestyle                                   description
==========================================  =================
``'-'`` or ``'solid'``                      solid line
``'--'`` or  ``'dashed'``                   dashed line
``'-.'`` or  ``'dashdot'``                  dash-dotted line
``':'`` or ``'dotted'``                     dotted line
``'none'``, ``'None'``, ``' '``, or ``''``  draw nothing
==========================================  =================

Alternatively a dash tuple of the following form can be provided::

    (offset, onoffseq)

where ``onoffseq`` is an even length tuple of on and off ink in points.

Parameters
----------
ls : {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
    The line style.
Nr.   )  r   NoneT)r   r   _get_dash_patternr?   r   r>   r@   r   )rI   r   s     rL   rA   Patch.set_linestyle  sh    2 :B""B&,&>&>r&B##11 ;((;*.//;
rN   c                     [        U5      U l        U R                  U R                  5        U R	                  U R
                  5        SU l        g)z@
Set whether to fill the patch.

Parameters
----------
b : bool
TN)r8   r9   r   r   r   r   r   rI   bs     rL   set_fillPatch.set_fill  s>     !W
D445D445
rN   c                     U R                   $ )z#Return whether the patch is filled.)r9   r   s    rL   get_fillPatch.get_fill      zzrN   c                 4    [        U5      nX l        SU l        g)z
Set the `.CapStyle`.

The default capstyle is 'round' for `.FancyArrowPatch` and 'butt' for
all other patches.

Parameters
----------
s : `.CapStyle` or %(CapStyle)s
TN)r   	_capstyler   )rI   scss      rL   rE   Patch.set_capstyle  s     a[
rN   c                 .    U R                   R                  $ )zReturn the capstyle.)r   namer   s    rL   get_capstylePatch.get_capstyle  s    ~~"""rN   c                 4    [        U5      nX l        SU l        g)z
Set the `.JoinStyle`.

The default joinstyle is 'round' for `.FancyArrowPatch` and 'miter' for
all other patches.

Parameters
----------
s : `.JoinStyle` or %(JoinStyle)s
TN)r   
_joinstyler   )rI   r   jss      rL   rF   Patch.set_joinstyle	  s     q\
rN   c                 .    U R                   R                  $ )zReturn the joinstyle.)r   r   r   s    rL   get_joinstylePatch.get_joinstyle  s    ###rN   c                 J    [         R                  " U5        Xl        SU l        g)a  
Set the hatching pattern.

*hatch* can be one of::

  /   - diagonal hatching
  \   - back diagonal
  |   - vertical
  -   - horizontal
  +   - crossed
  x   - crossed diagonal
  o   - small circle
  O   - large circle
  .   - dots
  *   - stars

Letters can be combined, in which case all the specified
hatchings are done.  If same letter repeats, it increases the
density of hatching of that pattern.

Parameters
----------
hatch : {'/', '\\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
TN)mhatch_validate_hatch_patternr   r   )rI   r   s     rL   rD   Patch.set_hatch  s    4 	&&u-
rN   c                     U R                   $ )zReturn the hatching pattern.)r   r   s    rL   	get_hatchPatch.get_hatch;      {{rN   c                     Xl         g)zSet the hatch linewidth.Nr7   )rI   r    s     rL   set_hatch_linewidthPatch.set_hatch_linewidth?  s     "rN   c                     U R                   $ )zReturn the hatch linewidth.r   r   s    rL   get_hatch_linewidthPatch.get_hatch_linewidthC      $$$rN   c                    UR                  SU R                  5       5        UR                  5       nUR                  U R                  SS9  U R
                  nU R                  S   S:X  d  U R                  S:X  a  SnUR                  U5        UR                  " U R                  6   UR                  U R                  5        UR                  U R                  5        UR                  U R                  5        U R!                  U5        UR#                  U R$                  5        UR'                  U R)                  5       5        UR+                  U R,                  5        U R.                  (       aQ  UR1                  U R.                  5        UR3                  U R4                  5        UR7                  U R8                  5        U R;                  5       b  UR<                  " U R;                  5       6   U R?                  5       (       a  SSK J!n  U" U R?                  5       U5      nU H  nURD                  " U/UQ76   M     URG                  5         URI                  S5        S	U l%        g)
a  
``draw()`` helper factored out for sharing with `FancyArrowPatch`.

Configure *renderer* and the associated graphics context *gc*
from the artist properties, then repeatedly call
``renderer.draw_path(gc, *draw_path_args)`` for each tuple
*draw_path_args* in *draw_path_args_list*.
patchT)isRGBArY   r   r   N)PathEffectRendererF)&
open_groupget_gidnew_gcset_foregroundr   r>   r   rB   
set_dashesr@   rE   r   rF   r   rC   r   _set_gc_clipset_url_urlset_snapget_snapr   r   r   rD   r   r6   r   r7   get_sketch_paramsset_sketch_paramsget_path_effectsmatplotlib.patheffectsr   	draw_pathrestoreclose_groupr   )rI   rendererdraw_path_args_listgcr    r   draw_path_argss          rL   "_draw_paths_with_artist_properties(Patch._draw_paths_with_artist_propertiesG  s    	GT\\^4__
$//$7__??1"doo&?B

t))*
'
)
4,,-"


499
DMMO$
T[[!;;LL%t001""4#8#89!!#/  $"8"8":;  ""A)$*?*?*A8LH1Nr3N3 2 	

W%
rN   c                    U R                  5       (       d  g U R                  5       nU R                  5       nUR                  U5      nUR	                  5       nU R                  UXEU R                  S   (       a  U R                  OS 4/5        g )NrY   )get_visiblerQ   rP   transform_path_non_affine
get_affiner  r   )rI   r  rT   	transformtpathaffines         rL   draw
Patch.drawy  s     !!}}&&(	33D9%%'// "&!3doo	? @	ArN   c                     [        S5      e)zReturn the path of this patch.Derived must overrideNotImplementedErrorr   s    rL   rQ   Patch.get_path  s    !"9::rN   c                 \    U R                  5       R                  U R                  5       5      $ rd   r   )rI   r  s     rL   get_window_extentPatch.get_window_extent  s"    }}**4+=+=+?@@rN   c                 X    U R                  US   5      nU R                  US   5      nX#4$ )z)Convert x and y units for a tuple (x, y).r   r   )convert_xunitsconvert_yunits)rI   xyrf   rg   s       rL   _convert_xy_unitsPatch._convert_xy_units  s1    1&1&trN   )r   r   r@   r   r   r9   r   r6   r7   r   r   r>   r   r   r   r?   r   rd   )7__name__
__module____qualname____firstlineno____doc__zorderr   r0   rV   r`   ry   re   r   r   r   rP   r   r   r   r\   r   r]   r   rC   r   r<   r   r=   r;   r   rB   rA   r   r   propertyr*   r   interpdrE   r   rF   r   rD   r   r   r   r  r
   allow_rasterizationr  rQ   r'  r-  __static_attributes____classcell__rK   s   @rL   r'   r'      s^    F M  !3* 3*j
2h<6|'7R6&AN1	.!	#	# 6!F Hh'D #  $<#%0d A  A ;A rN   r'   c                   r   ^  \ rS rSrS r\R                  SS.U 4S jj5       rS rS r	S r
U 4S	 jrS
rU =r$ )Shadowi  c                 "    SU R                    S3$ )NzShadow())r   r   s    rL   __str__Shadow.__str__  s    A&&rN   gffffff?)shadec          	        > [         TU ]  5         Xl        X#sU l        U l        [
        R                  " 5       U l        U R                  U R                  5        SUs=::  a  S::  d  O  [        S5      eSU-
  [        R                  " [        R                  " U R                  R                  5       5      5      -  nU R                  XfS[        R                   " U R                  R"                  [        R$                  * 5      S.UE5        g)a  
Create a shadow of the given *patch*.

By default, the shadow will have the same face color as the *patch*,
but darkened. The darkness can be controlled by *shade*.

Parameters
----------
patch : `~matplotlib.patches.Patch`
    The patch to create the shadow for.
ox, oy : float
    The shift of the shadow in data coordinates, scaled by a factor
    of dpi/72.
shade : float, default: 0.7
    How the darkness of the shadow relates to the original color. If 1, the
    shadow is black, if 0, the shadow has the same color as the *patch*.

    .. versionadded:: 3.8

**kwargs
    Properties of the shadow patch. Supported keys are:

    %(Patch:kwdoc)s
r   r   zshade must be between 0 and 1.      ?)r#   r"   r   r4  N)r/   r0   r   _ox_oyr   r   _shadow_transformr   
ValueErrorrp   asarrayr   to_rgbr   update	nextafterr4  inf)rI   r   oxoyrA  rJ   r)   rK   s          rL   r0   Shadow.__init__  s    4 	
$(!+!4!4!6$EQ=>>Ubjjtzz7O7O7Q)RSS%c!||DJJ,=,=wG  	 rN   c                     UR                  U R                  5      nUR                  U R                  5      nU R                  R	                  5       R                  X#5        g rd   )points_to_pixelsrD  rE  rF  clear	translate)rI   r  rM  rN  s       rL   _update_transformShadow._update_transform  sG    &&txx0&&txx0$$&008rN   c                 6    U R                   R                  5       $ rd   )r   rQ   r   s    rL   rQ   Shadow.get_path  s    zz""$$rN   c                 P    U R                   R                  5       U R                  -   $ rd   )r   r   rF  r   s    rL   r   Shadow.get_patch_transform  s     zz--/$2H2HHHrN   c                 F   > U R                  U5        [        TU ]	  U5        g rd   )rT  r/   r  rI   r  rK   s     rL   r  Shadow.draw  s    x(XrN   )rD  rE  rF  r   )r/  r0  r1  r2  r?  r   r6  r0   rT  rQ   r   r  r8  r9  r:  s   @rL   r<  r<    s@    ' /2 %  % N9
%I rN   r<  c                     ^  \ rS rSrSrS r\R                  SSS.U 4S jj5       rS r	S	 r
S
 r\S 5       r\R                  S 5       rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS r\" \\5      rSr U =r!$ )	Rectanglei  a  
A rectangle defined via an anchor point *xy* and its *width* and *height*.

The rectangle extends from ``xy[0]`` to ``xy[0] + width`` in x-direction
and from ``xy[1]`` to ``xy[1] + height`` in y-direction. ::

  :                +------------------+
  :                |                  |
  :              height               |
  :                |                  |
  :               (xy)---- width -----+

One may picture *xy* as the bottom left corner, but which corner *xy* is
actually depends on the direction of the axis and the sign of *width*
and *height*; e.g. *xy* would be the bottom right corner if the x-axis
was inverted or if *width* was negative.
c                     U R                   U R                  U R                  U R                  U R                  4nSnX!-  $ )Nz5Rectangle(xy=(%g, %g), width=%g, height=%g, angle=%g))_x0_y0_width_heightanglerI   parsfmts      rL   r?  Rectangle.__str__  s3    xx4;;djjHEzrN           r,  )rd  rotation_pointc                   > [         TU ]  " S0 UD6  US   U l        US   U l        X l        X0l        [        U5      U l        XPl        SU l	        U R                  5         g)a(  
Parameters
----------
xy : (float, float)
    The anchor point.
width : float
    Rectangle width.
height : float
    Rectangle height.
angle : float, default: 0
    Rotation in degrees anti-clockwise about the rotation point.
rotation_point : {'xy', 'center', (number, number)}, default: 'xy'
    If ``'xy'``, rotate around the anchor point. If ``'center'`` rotate
    around the center. If 2-tuple of number, rotate around this
    coordinate.

Other Parameters
----------------
**kwargs : `~matplotlib.patches.Patch` properties
    %(Patch:kwdoc)s
r   r         ?N )r/   r0   r`  ra  rb  rc  r   rd  rj  _aspect_ratio_correction_convert_units)rI   r,  widthheightrd  rj  rJ   rK   s          rL   r0   Rectangle.__init__  s\    0 	"6"a5a55\
, ),%rN   c                 ,    [         R                  " 5       $ )z%Return the vertices of the rectangle.)r   unit_rectangler   s    rL   rQ   Rectangle.get_path  s    ""$$rN   c                    U R                  U R                  5      nU R                  U R                  5      nU R                  U R                  U R                  -   5      nU R                  U R                  U R
                  -   5      nXX44$ )z Convert bounds of the rectangle.)r*  r`  r+  ra  rb  rc  )rI   x0y0x1y1s        rL   ro  Rectangle._convert_units  sn      *  *  DKK!78  DLL!89r~rN   c                    U R                  5       nU R                  S:X  aV  UR                  UR                  -
  UR                  UR
                  -
  p2UR                  US-  -   UR
                  US-  -   4nO5U R                  S:X  a  UR                  UR
                  4nOU R                  n[        R                  " U5      [        R                  " 5       R                  US   * US   * 5      R                  SU R                  5      R                  U R                  5      R                  SSU R                  -  5      R                  " U6 -   $ )Ncenter       @r,  r   r   )get_bboxrj  ry  rw  rz  rx  r   BboxTransformTor   rS  scalern  
rotate_degrd  )rI   bboxrp  rq  rj  s        rL   r   Rectangle.get_patch_transform   s   
 }}(* GGdgg-tww/@6!WWurz1477Vb[3HHN  D(!WWdgg-N!00N))$/%%'N1--q0A/ABq$778DJJ'q!d;;;<
 +,, 	,rN   c                     U R                   $ )z The rotation point of the patch.)_rotation_pointr   s    rL   rj  Rectangle.rotation_point5  s     ###rN   c                     US;   dT  [        U[        5      (       aF  [        U5      S:X  a7  [        US   [        5      (       a  [        US   [        5      (       a  Xl        g [        S5      e)N)r}  r,     r   r   zC`rotation_point` must be one of {'xy', 'center', (number, number)}.)rZ   tuplerG   r   r  rG  )rI   values     rL   rj  r  :  s^    $$5%((SZ1_58T**z%(D/I/I#(  C D DrN   c                     U R                   $ )z,Return the left coordinate of the rectangle.)r`  r   s    rL   get_xRectangle.get_xE      xxrN   c                     U R                   $ )z.Return the bottom coordinate of the rectangle.)ra  r   s    rL   get_yRectangle.get_yI  r  rN   c                 2    U R                   U R                  4$ )z>Return the left and bottom coords of the rectangle as a tuple.)r`  ra  r   s    rL   get_xyRectangle.get_xyM  s    xx!!rN   c                 D    U R                  5       R                  / SQ5      $ )zK
Return the corners of the rectangle, moving anti-clockwise from
(x0, y0).
)r   r   r   r   r   r   r   r   r   r  r   s    rL   get_cornersRectangle.get_cornersQ  s#    
 '')33,. 	.rN   c                 @    U R                  5       R                  S5      $ )z#Return the centre of the rectangle.)rC  rC  r  r   s    rL   
get_centerRectangle.get_centerY  s    '')33J??rN   c                     U R                   $ z"Return the width of the rectangle.rb  r   s    rL   	get_widthRectangle.get_width]  r   rN   c                     U R                   $ z#Return the height of the rectangle.rc  r   s    rL   
get_heightRectangle.get_heighta      ||rN   c                     U R                   $ )z"Get the rotation angle in degrees.rd  r   s    rL   	get_angleRectangle.get_anglee  r   rN   c                     Xl         SU l        g)z)Set the left coordinate of the rectangle.TN)r`  r   rI   rf   s     rL   set_xRectangle.set_xi      
rN   c                     Xl         SU l        g)z+Set the bottom coordinate of the rectangle.TN)ra  r   rI   rg   s     rL   set_yRectangle.set_yn  r  rN   c                     Xl         SU l        g)z[
Set the rotation angle in degrees.

The rotation is performed anti-clockwise around *xy*.
TN)rd  r   rI   rd  s     rL   	set_angleRectangle.set_angles  s     

rN   c                 0    Uu  U l         U l        SU l        g)zb
Set the left and bottom coordinates of the rectangle.

Parameters
----------
xy : (float, float)
TN)r`  ra  r   rI   r,  s     rL   set_xyRectangle.set_xy|  s      $(
rN   c                     Xl         SU l        g)zSet the width of the rectangle.TNrb  r   r   s     rL   	set_widthRectangle.set_width  s    
rN   c                     Xl         SU l        g)z Set the height of the rectangle.TNrc  r   rI   hs     rL   
set_heightRectangle.set_height  s    
rN   c                 |    [        U5      S:X  a	  US   u  p#pEOUu  p#pEX l        X0l        X@l        XPl        SU l        g)a  
Set the bounds of the rectangle as *left*, *bottom*, *width*, *height*.

The values may be passed as separate parameters or as a tuple::

    set_bounds(left, bottom, width, height)
    set_bounds((left, bottom, width, height))

.. ACCEPTS: (left, bottom, width, height)
r   r   TN)rG   r`  ra  rb  rc  r   rI   argslr   r   r  s         rL   
set_boundsRectangle.set_bounds  sB     t9>aJA!QJA!
rN   c                 X    [         R                  R                  " U R                  5       6 $ zReturn the `.Bbox`.)r   Bboxfrom_extentsro  r   s    rL   r  Rectangle.get_bbox  s     ++T-@-@-BCCrN   )	rn  rc  r  rb  r`  ra  rd  rj  r   )"r/  r0  r1  r2  r3  r?  r   r6  r0   rQ   ro  r   r5  rj  setterr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r,  r8  r9  r:  s   @rL   r^  r^    s    $
 4% %N%,* $ $ D D".@

	

*D 
&&	!BrN   r^  c                   f   ^  \ rS rSrSrS r\R                  SSS.U 4S jj5       rS r	S	 r
S
rU =r$ )RegularPolygoni  zA regular polygon patch.c                     SnXR                   S   U R                   S   U R                  U R                  U R                  4-  $ )Nz7RegularPolygon((%g, %g), %d, radius=%g, orientation=%g)r   r   )r,  numverticesr^   orientationrI   r   s     rL   r?  RegularPolygon.__str__  sB    EGGAJ
D,<,<dkk$$& & 	&rN      r   r^   r  c                   > Xl         X l        X@l        X0l        [        R
                  " U5      U l        [        R                  " 5       U l	        [        TU ],  " S0 UD6  g)a6  
Parameters
----------
xy : (float, float)
    The center position.

numVertices : int
    The number of vertices.

radius : float
    The distance from the center to each of the vertices.

orientation : float
    The polygon rotation angle (in radians).

**kwargs
    `Patch` properties:

    %(Patch:kwdoc)s
Nrm  )r,  r  r  r^   r   unit_regular_polygon_pathr   r   _patch_transformr/   r0   )rI   r,  numVerticesr^   r  rJ   rK   s         rL   r0   RegularPolygon.__init__  sN    . &&..{;
 * 3 3 5"6"rN   c                     U R                   $ rd   r  r   s    rL   rQ   RegularPolygon.get_path      zzrN   c                     U R                   R                  5       R                  U R                  5      R	                  U R
                  5      R                  " U R                  6 $ rd   )r  rR  r  r^   rotater  rS  r,  r   s    rL   r   "RegularPolygon.get_patch_transform  sO    $$**,U4;;VD$$%Y ! 	!rN   )r  r  r  r  r^   r,  )r/  r0  r1  r2  r3  r?  r   r6  r0   rQ   r   r8  r9  r:  s   @rL   r  r    s9    "&
 q# #<! !rN   r  c                   `   ^  \ rS rSrSrSrS r\R                  U 4S j5       r	S r
S rSrU =r$ )		PathPatchi  zA general polycurve path patch.Tc                     SnU[        U R                  R                  5      /[        U R                  R                  S   5      Q7-  $ )NzPathPatch%d((%g, %g) ...)r   )rG   r  ro   r  r  s     rL   r?  PathPatch.__str__  s=    'C

++,MuTZZ5H5H5K/LMMMrN   c                 2   > [         TU ]  " S0 UD6  Xl        g)zL
*path* is a `.Path` object.

Valid keyword arguments are:

%(Patch:kwdoc)s
Nrm  )r/   r0   r  )rI   rT   rJ   rK   s      rL   r0   PathPatch.__init__  s     	"6"
rN   c                     U R                   $ rd   r  r   s    rL   rQ   PathPatch.get_path  r  rN   c                     Xl         g rd   r  )rI   rT   s     rL   set_pathPathPatch.set_path  s    
rN   r  )r/  r0  r1  r2  r3  r   r?  r   r6  r0   rQ   r  r8  r9  r:  s   @rL   r  r    s:    )MN 	 	 rN   r  c                   n   ^  \ rS rSrSrSr\R                  SSS.U 4S jj5       rS r	S	 r
SS
 jrSrU =r$ )	StepPatchi  z
A path patch describing a stepwise constant function.

By default, the path is not closed and starts and stops at
baseline value.
Fverticalr   )r  baselinec                  > X0l         [        R                  " U5      U l        [        R                  " U5      U l        Ub  [        R                  " U5      OSU l        U R                  5         [        TU ]   " U R                  40 UD6  g)a  
Parameters
----------
values : array-like
    The step heights.

edges : array-like
    The edge positions, with ``len(edges) == len(vals) + 1``,
    between which the curve takes on vals values.

orientation : {'vertical', 'horizontal'}, default: 'vertical'
    The direction of the steps. Vertical means that *values* are
    along the y-axis, and edges are along the x-axis.

baseline : float, array-like or None, default: 0
    The bottom value of the bounding edges or when
    ``fill=True``, position of lower edge. If *fill* is
    True or an array is passed to *baseline*, a closed
    path is drawn.

**kwargs
    `Patch` properties:

    %(Patch:kwdoc)s
N)
r  rp   rH  _edges_values	_baseline_update_pathr/   r0   r  )rI   valuesedgesr  r  rJ   rK   s         rL   r0   StepPatch.__init__  sd    8 'jj'zz&)191EH-4.v.rN   c                    [         R                  " [         R                  " U R                  5      5      (       a  [	        S5      eU R                  R
                  S-
  U R                  R
                  :w  a:  [	        SU R                  R
                   SU R                  R
                   S35      e[         R                  " S5      /[         R                  " S[        R                  S9/p![         R                  " U R                  5      nU R                  b#  U[         R                  " U R                  5      -  n[        R                  " U) 5       GH  u  pE[         R                  " U R                  XES-    S	5      n[         R                  " U R                  XE S	5      nU R                  c  [         R                  " US S XwS
S  /5      nOU R                  R                  S:X  a/  [         R                  " U R                  /XpR                  //5      nOU R                  R                  S:X  am  [         R                  " U R                  XE S	5      S S S
2   n[         R                  " XfS S S
2   /5      n[         R                  " US
S  XxS S US S XS
S  /5      nO[	        S5      eU R                   S:X  a  [         R"                  " Xg/5      n	O[         R"                  " Xv/5      n	UR%                  U	5        UR%                  [        R&                  /[        R(                  /[+        U	5      S-
  -  -   5        GM     [        [         R                  " U5      [         R                  " U5      5      U l        g )Nz$Nan values in "edges" are disallowedr   ziSize mismatch between "values" and "edges". Expected `len(values) + 1 == len(edges)`, but `len(values) = z` and `len(edges) = z`.r   r  r   )dtyper  zInvalid `baseline` specifiedr  )rp   isnansumr  rG  sizer  emptyr   	code_typer  r   contiguous_regionsrepeatconcatenatendimr  column_stackappendrr   LINETOrG   r  )
rI   vertsrn   	_nan_maskidx0idx1rf   rg   baser,  s
             rL   r   StepPatch._update_path'  s   88BFF4;;'((CDD;;a4<<#4#44 //3||/@/@.A B..2kk.>.>-?rC D D
 ()BHHQdnn,M+NuHHT\\*	>>%$..11I22I:>JD		$++d62A6A		$,,t115A~~%NNAbqE1f#56$$)NNT^^$4a..9I#JK$$)yy!:A>ttDNNA2w<0NNDIqr($(!HdI$? @ !!?@@:-__aV,__aV,LLLL$++$++B	)BBC' ?( "../1FG
rN   c                 j    [        SS5      nU" U R                  U R                  U R                  5      $ )z:Get `.StepPatch` values, edges and baseline as namedtuple.	StairDatazvalues edges baseline)r   r  r  r  )rI   r  s     rL   get_dataStepPatch.get_dataK  s*    {,CD	t{{DNNCCrN   c                    Uc  Uc  Uc  [        S5      eUb  [        R                  " U5      U l        Ub  [        R                  " U5      U l        Ub  [        R                  " U5      U l        U R                  5         SU l        g)z
Set `.StepPatch` values, edges and baseline.

Parameters
----------
values : 1D array-like or None
    Will not update values, if passing None
edges : 1D array-like, optional
baseline : float, 1D array-like or None
Nz)Must set *values*, *edges* or *baseline*.T)rG  rp   rH  r  r  r  r   r   )rI   r  r  r  s       rL   set_dataStepPatch.set_dataP  ss     >em0@HII::f-DL**U+DKZZ1DN
rN   )r  r  r  r  r  r   )NNN)r/  r0  r1  r2  r3  r   r   r6  r0   r   r  r  r8  r9  r:  s   @rL   r  r    sD     M'! /  /D"HHD
 rN   r  c                      ^  \ rS rSrSrS r\R                  SS.U 4S jj5       rS r	S r
S	 rS
 rS r\" \\SS9rSrU =r$ )Polygonig  zA general polygon patch.c                     [        U R                  R                  5      (       a?  SnU[        U R                  R                  5      /U R                  R                  S   Q7-  $ g)NzPolygon%d((%g, %g) ...)r   z
Polygon0())rG   r  ro   r  s     rL   r?  Polygon.__str__j  sP    tzz""##)ADJJ//0J4::3F3Fq3IJJJrN   Tclosedc                T   > [         TU ]  " S0 UD6  X l        U R                  U5        g)z
Parameters
----------
xy : (N, 2) array

closed : bool, default: True
    Whether the polygon is closed (i.e., has identical start and end
    points).

**kwargs
    %(Patch:kwdoc)s
Nrm  )r/   r0   _closedr  )rI   r,  r&  rJ   rK   s       rL   r0   Polygon.__init__q  s%     	"6"BrN   c                     U R                   $ )zGet the `.Path` of the polygon.r  r   s    rL   rQ   Polygon.get_path  r   rN   c                     U R                   $ )z%Return whether the polygon is closed.)r(  r   s    rL   
get_closedPolygon.get_closed  r  rN   c                     U R                   [        U5      :X  a  g[        U5      U l         U R                  U R                  5       5        SU l        g)zk
Set whether the polygon is closed.

Parameters
----------
closed : bool
    True if the polygon is closed
NT)r(  r8   r  r  r   )rI   r&  s     rL   
set_closedPolygon.set_closed  s;     <<4<'F|DKKM"
rN   c                 .    U R                   R                  $ )zb
Get the vertices of the path.

Returns
-------
(N, 2) array
    The coordinates of the vertices.
)r  ro   r   s    rL   r  Polygon.get_xy  s     zz"""rN   c                    [         R                  " U5      nUR                  u  p#U R                  (       aF  US:X  d$  US:  a9  US   US   :g  R	                  5       (       a  [         R
                  " XS   //5      nO)US:  a#  US   US   :H  R                  5       (       a  USS n[        XR                  S9U l        SU l	        g)a}  
Set the vertices of the polygon.

Parameters
----------
xy : (N, 2) array-like
    The coordinates of the vertices.

Notes
-----
Unlike `.Path`, we do not ignore the last input vertex. If the
polygon is meant to be closed, and the last point of the polygon is not
equal to the first, we assume that the user has not explicitly passed a
``CLOSEPOLY`` vertex, and add it ourselves.
r   r   r  r  Nr%  T)
rp   rH  shaper(  ru   r  allr   r  r   )rI   r,  nverts_s       rL   r  Polygon.set_xy  s      ZZ^HH	<<
 {fqjber"vo-B-B-D-D^^RQ%M2 zr!u23355W"\\2

rN   z+The vertices of the path as a (N, 2) array.)doc)r(  r  r   )r/  r0  r1  r2  r3  r?  r   r6  r0   rQ   r-  r0  r  r  r5  r,  r8  r9  r:  s   @rL   r"  r"  g  sV    "  %)  "	#B 
&&C
EBrN   r"  c                      ^  \ rS rSrSrS r\R                  SS.U 4S jj5       rS r	S r
S	 rS
 rS rS rS rSrU =r$ )Wedgei  zWedge shaped patch.c                     U R                   S   U R                   S   U R                  U R                  U R                  U R                  4nSnX!-  $ )Nr   r   z<Wedge(center=(%g, %g), r=%g, theta1=%g, theta2=%g, width=%s))r}  rtheta1theta2rp  re  s      rL   r?  Wedge.__str__  sD    AAT[[$**6LzrN   Nrp  c                   > [         TU ]  " S0 UD6  Xl        X%sU l        U l        X4sU l        U l        [        R                  " 5       U l	        U R                  5         g)z
A wedge centered at *x*, *y* center with radius *r* that
sweeps *theta1* to *theta2* (in degrees).  If *width* is given,
then a partial wedge is drawn from inner radius *r* - *width*
to outer radius *r*.

Valid keyword arguments are:

%(Patch:kwdoc)s
Nrm  )r/   r0   r}  r>  rp  r?  r@  r   r   r  _recompute_path)rI   r}  r>  r?  r@  rp  rJ   rK   s          rL   r0   Wedge.__init__  sS     	"6"
#) T[ * < < >rN   c                    [        U R                  U R                  -
  S-
  5      S::  a  Su  p[        R                  nO'U R                  U R                  p![        R
                  n[        R                  " X5      nU R                  b  UR                  nUR                  S S S2   U R                  U R                  -
  -  U R                  -  n[        R                  " XVS//5      n/ UR                  QUPUR                  SS  Q[        R                  PnOD[        R                  " UR                  SS//5      n/ UR                  QUP[        R                  Pn[        XpR                  -  U R                  -   U5      U l        g )Nh  g-q=)r   rG  r  r  r   )absr@  r?  r   rr   r  arcrp  ro   r>  rp   r  rn   	CLOSEPOLYr}  r  )	rI   r?  r@  	connectorrI  v1v2vr   s	            rL   rD  Wedge._recompute_path  s4   dkk)S01U:#NFI![[$++FI hhv&::! Bdd#tvv

':;dffDB12AG#))GYG12GGA vv.>?@A7#))7Y77A !ff*t{{2A6
rN   c                 ,    S U l         Xl        SU l        g NT)r  r}  r   )rI   r}  s     rL   
set_centerWedge.set_center      

rN   c                 ,    S U l         Xl        SU l        g rQ  )r  r>  r   rI   r^   s     rL   
set_radiusWedge.set_radius  s    

rN   c                 ,    S U l         Xl        SU l        g rQ  )r  r?  r   )rI   r?  s     rL   
set_theta1Wedge.set_theta1  rT  rN   c                 ,    S U l         Xl        SU l        g rQ  )r  r@  r   )rI   r@  s     rL   
set_theta2Wedge.set_theta2  rT  rN   c                 ,    S U l         Xl        SU l        g rQ  )r  rp  r   rI   rp  s     rL   r  Wedge.set_width  s    


rN   c                 T    U R                   c  U R                  5         U R                   $ rd   r  rD  r   s    rL   rQ   Wedge.get_path  "    ::  "zzrN   )r  r  r}  r>  r   r?  r@  rp  )r/  r0  r1  r2  r3  r?  r   r6  r0   rD  rR  rW  rZ  r]  r  rQ   r8  r9  r:  s   @rL   r<  r<    sP     ;?  $76




 rN   r<  c            
          ^  \ rS rSrSrS r\R                  " SS/SS/SS/SS/S	S/SS
/SS//5      r\	R                  S	S.U 4S jj5       rS rS rSS jrSrU =r$ )Arrowi!  zAn arrow patch.c                     g)NzArrow()rm  r   s    rL   r?  Arrow.__str__$  s    rN   ri  皙?g皙?g333333ӿrl  333333?rB  c                L   > [         TU ]  " S0 UD6  U R                  XX4U5        g)a  
Draws an arrow from (*x*, *y*) to (*x* + *dx*, *y* + *dy*).
The width of the arrow is scaled by *width*.

Parameters
----------
x : float
    x coordinate of the arrow tail.
y : float
    y coordinate of the arrow tail.
dx : float
    Arrow length in the x direction.
dy : float
    Arrow length in the y direction.
width : float, default: 1
    Scale factor for the width of the arrow. With a default value of 1,
    the tail width is 0.2 and head width is 0.6.
**kwargs
    Keyword arguments control the `Patch` properties:

    %(Patch:kwdoc)s

See Also
--------
FancyArrow
    Patch that allows independent control of the head and tail
    properties.
Nrm  )r/   r0   r  )rI   rf   rg   dxdyrp  rJ   rK   s          rL   r0   Arrow.__init__+  s%    < 	"6"aBE*rN   c                     U R                   $ rd   r  r   s    rL   rQ   Arrow.get_pathL  r  rN   c                     U R                   $ rd   )r  r   s    rL   r   Arrow.get_patch_transformO  s    $$$rN   c                    Ub  Xl         Ub  X l        Ub  X0l        Ub  X@l        Ub  XPl        [
        R                  " 5       R                  [        R                  " U R                  U R                  5      U R                  5      R                  [        R                  " U R                  U R                  5      5      R                  U R                   U R                  5      R                  5       U l        g)aY  
Set `.Arrow` x, y, dx, dy and width.
Values left as None will not be updated.

Parameters
----------
x, y : float or None, default: None
    The x and y coordinates of the arrow base.

dx, dy : float or None, default: None
    The length of the arrow along x and y direction.

width : float or None, default: None
    Width of full arrow tail.
N)_x_y_dx_dyrb  r   r   r  rp   hypotr  arctan2rS  frozenr  )rI   rf   rg   rn  ro  rp  s         rL   r  Arrow.set_dataR  s      =G=G>H>HK!U288DHHdhh/=VBJJtxx23Ytww(VX 	rN   )rx  ry  r  rb  rv  rw  )NNNNN)r/  r0  r1  r2  r3  r?  r   _create_closedr  r   r6  r0   rQ   r   r  r8  r9  r:  s   @rL   rg  rg  !  s     	c
S$K#tsDkC:	c
S#J!  !E .1 + +@% rN   rg  c            	          ^  \ rS rSrSrSrS r\R                  SSSSSS	SS
.U 4S jj5       r	SSSSSSSS.S jr
S rSrU =r$ )
FancyArrowit  zH
Like Arrow, but lets you set head width and head height independently.
Tc                     g)NzFancyArrow()rm  r   s    rL   r?  FancyArrow.__str__{  s    rN   gMbP?FNfullr   )rp  length_includes_head
head_widthhead_lengthr5  overhanghead_starts_at_zeroc                   > Xl         X l        X0l        X@l        XPl        X`l        Xpl        Xl        Xl        Xl	        Xl
        U R                  5         [        TU ]4  " U R                  4SS0UD6  g)a  
Parameters
----------
x, y : float
    The x and y coordinates of the arrow base.

dx, dy : float
    The length of the arrow along x and y direction.

width : float, default: 0.001
    Width of full arrow tail.

length_includes_head : bool, default: False
    True if head is to be counted in calculating the length.

head_width : float or None, default: 3*width
    Total width of the full arrow head.

head_length : float or None, default: 1.5*head_width
    Length of arrow head.

shape : {'full', 'left', 'right'}, default: 'full'
    Draw the left-half, right-half, or full arrow.

overhang : float, default: 0
    Fraction that the arrow is swept back (0 overhang means
    triangular shape). Can be negative or greater than one.

head_starts_at_zero : bool, default: False
    If True, the head starts being drawn at coordinate 0
    instead of ending at coordinate 0.

**kwargs
    `.Patch` properties:

    %(Patch:kwdoc)s
r&  TN)rv  rw  rx  ry  rb  _length_includes_head_head_width_head_length_shape	_overhang_head_starts_at_zero_make_vertsr/   r0   r  )rI   rf   rg   rn  ro  rp  r  r  r  r5  r  r  rJ   rK   s                rL   r0   FancyArrow.__init__~  sh    T %9"%'!$7!;D;F;rN   )rf   rg   rn  ro  rp  r  r  c                    Ub  Xl         Ub  X l        Ub  X0l        Ub  X@l        Ub  XPl        Ub  X`l        Ub  Xpl        U R                  5         U R                  U R                  5        g)a  
Set `.FancyArrow` x, y, dx, dy, width, head_with, and head_length.
Values left as None will not be updated.

Parameters
----------
x, y : float or None, default: None
    The x and y coordinates of the arrow base.

dx, dy : float or None, default: None
    The length of the arrow along x and y direction.

width : float or None, default: None
    Width of full arrow tail.

head_width : float or None, default: None
    Total width of the full arrow head.

head_length : float or None, default: None
    Length of arrow head.
N)
rv  rw  rx  ry  rb  r  r  r  r  r  )rI   rf   rg   rn  ro  rp  r  r  s           rL   r  FancyArrow.set_data  sk    . =G=G>H>HK!)" +DJJrN   c                 \   U R                   c  SU R                  -  nOU R                   nU R                  c  SU-  nOU R                  n[        R                  " U R
                  U R                  5      nU R                  (       a  UnOX2-   nU(       d  [        R                  " SS/5      U l	        g XpeU R                  U R                  p[        R                  " SS/U* U* S-  /U* SU-
  -  U* S-  /U* U* S-  /U* S//5      n	U R                  (       d  XS/-  n	U R                  (       a	  XS-  S/-  n	U R                  S:X  a  U	n
OeU	SS/-  nU R                  S	:X  a  Un
OKU R                  S
:X  a"  [        R                  " U	S S USS S2   /5      n
O[        SU R                  < 35      eUS:w  a  U R
                  U-  nU R                  U-  nOSu  pX/U* U//n[        R                   " X5      U R"                  U R
                  -   U R$                  U R                  -   /-   U l	        g )NrY   g      ?r   r  ri  r   leftr  rightr  zGot unknown shape: r  )r  rb  r  rp   rz  rx  ry  r  r  r  r  arrayr  r  r  rG  dotrv  rw  )rI   r  r  distancelengthhwhlhsr    left_half_arrowcoordsright_half_arrowcxsxMs                  rL   r  FancyArrow._make_verts  s*   #T[[J))J$
*K++K88DHHdhh/%%F+F1a&)DJ  ^^T[[ hhc
rcAgB"q)2#'"!( O --#33((!OQ#77{{f$(#2aW#< ;;')-F[[F*  ^^_Sb-A-=bf"f-E-G HF %':4;;/%JKK1}XX(XX( RC9%A*$(("$((". DJrN   )rx  ry  r  r  r  r  r  r  rb  rv  rw  r  )r/  r0  r1  r2  r3  r   r?  r   r6  r0   r  r  r8  r9  r:  s   @rL   r  r  t  sb     M 5T!!%*5< 5<n !DTd$ d& P< <rN   r  
r   r  )r  c                   \   ^  \ rS rSrSrS r\R                  SSS.U 4S jjj5       rSr	U =r
$ )	CirclePolygoni"  z*A polygon-approximation of a circle patch.c                 r    SnXR                   S   U R                   S   U R                  U R                  4-  $ )Nz1CirclePolygon((%g, %g), radius=%g, resolution=%d)r   r   )r,  r^   r  r  s     rL   r?  CirclePolygon.__str__%  s3    ?GGAJ
DKK9I9IJJJrN      )
resolutionc                .   > [         TU ]  " X4USS.UD6  g)z
Create a circle at *xy* = (*x*, *y*) with given *radius*.

This circle is approximated by a regular polygon with *resolution*
sides.  For a smoother circle drawn with splines, see `Circle`.

Valid keyword arguments are:

%(Patch:kwdoc)s
r   r  Nr/   r0   )rI   r,  r^   r  rJ   rK   s        rL   r0   CirclePolygon.__init__)  s*     		D#)q	D<B	DrN   rm  r  )r/  r0  r1  r2  r3  r?  r   r6  r0   r8  r9  r:  s   @rL   r  r  "  s7    4K DD D DrN   r  c                      ^  \ rS rSrSrS r\R                  SS.U 4S jj5       rS r	S r
S	 rS
 rS r\" \\5      rS rS r\" \\5      rS rS r\" \\5      rS rS r\" \\5      rS rS rS rSrU =r$ )Ellipsei;  zA scale-free ellipse.c                     U R                   S   U R                   S   U R                  U R                  U R                  4nSnX!-  $ )Nr   r   z3Ellipse(xy=(%s, %s), width=%s, height=%s, angle=%s))_centerrp  rq  rd  re  s      rL   r?  Ellipse.__str__>  s>    Qa

DKK5CzrN   r   r  c                   > [         TU ]  " S0 UD6  Xl        X#sU l        U l        X@l        [        R                  " 5       U l        SU l	        [        R                  " 5       U l        g)aI  
Parameters
----------
xy : (float, float)
    xy coordinates of ellipse centre.
width : float
    Total length (diameter) of horizontal axis.
height : float
    Total length (diameter) of vertical axis.
angle : float, default: 0
    Rotation in degrees anti-clockwise.

Notes
-----
Valid keyword arguments are:

%(Patch:kwdoc)s
rl  Nrm  )r/   r0   r  rb  rc  _angler   unit_circler  rn  r   r   r  )rI   r,  rp  rq  rd  rJ   rK   s         rL   r0   Ellipse.__init__D  sX    ( 	"6"$)!T\%%'
 ),% * < < >rN   c                    U R                  U R                  S   5      U R                  U R                  S   5      4nU R                  U R                  5      nU R                  U R                  5      n[
        R                  " 5       R                  US-  US-  U R                  -  5      R                  U R                  5      R                  SSU R                  -  5      R                  " U6 U l        g)z
Notes
-----
This cannot be called until after this has been added to an Axes,
otherwise unit conversion will fail. This makes it very important to
call the accessor method and not directly access the transformation
member variable.
r   r   rC  N)r*  r  r+  rb  rc  r   r   r  rn  r  rd  rS  r  )rI   r}  rp  rq  s       rL   _recompute_transformEllipse._recompute_transformg  s     %%dll1o6%%dll1o68##DKK0$$T\\2 * 3 3 5U53;t/L/L LMZ

#U1a$7778Y	! 	! rN   c                     U R                   $ )zReturn the path of the ellipse.r  r   s    rL   rQ   Ellipse.get_pathz  r   rN   c                 :    U R                  5         U R                  $ rd   )r  r  r   s    rL   r   Ellipse.get_patch_transform~  s    !!#$$$rN   c                     Xl         SU l        g)zK
Set the center of the ellipse.

Parameters
----------
xy : (float, float)
TN)r  r   r  s     rL   rR  Ellipse.set_center  s     
rN   c                     U R                   $ )z!Return the center of the ellipse.r  r   s    rL   r  Ellipse.get_center  r  rN   c                     Xl         SU l        g)zD
Set the width of the ellipse.

Parameters
----------
width : float
TNr  r`  s     rL   r  Ellipse.set_width       
rN   c                     U R                   $ )z"
Return the width of the ellipse.
r  r   s    rL   r  Ellipse.get_width  s     {{rN   c                     Xl         SU l        g)zF
Set the height of the ellipse.

Parameters
----------
height : float
TNr  )rI   rq  s     rL   r  Ellipse.set_height  s     
rN   c                     U R                   $ )z!Return the height of the ellipse.r  r   s    rL   r  Ellipse.get_height  r  rN   c                     Xl         SU l        g)zD
Set the angle of the ellipse.

Parameters
----------
angle : float
TN)r  r   r  s     rL   r  Ellipse.set_angle  r  rN   c                     U R                   $ )z Return the angle of the ellipse.r  r   s    rL   r  Ellipse.get_angle  r   rN   c                 D    U R                  5       R                  / SQ5      $ )z
Return the corners of the ellipse bounding box.

The bounding box orientation is moving anti-clockwise from the
lower left corner defined before rotation.
))r  r  )r   r  r  )r  r   r  r   s    rL   r  Ellipse.get_corners  s#     '')3302 	2rN   c                     U R                   U R                  :  a"  U R                  5       R                  SS/5      nO!U R                  5       R                  SS/5      nU Vs/ s H  n[	        U5      PM     sn$ s  snf )z
Return the vertices coordinates of the ellipse.

The definition can be found `here <https://en.wikipedia.org/wiki/Ellipse>`_

.. versionadded:: 3.8
r  r   r  r  r  r   rp  rq  r   r  r  rI   retrf   s      rL   get_verticesEllipse.get_vertices  l     ::#**,667HIC**,667HIC"%&#Qa#&&&   "A:c                     U R                   U R                  :  a"  U R                  5       R                  SS/5      nO!U R                  5       R                  SS/5      nU Vs/ s H  n[	        U5      PM     sn$ s  snf )z
Return the co-vertices coordinates of the ellipse.

The definition can be found `here <https://en.wikipedia.org/wiki/Ellipse>`_

.. versionadded:: 3.8
r  r  r  r  r  r  s      rL   get_co_verticesEllipse.get_co_vertices  r  r  )r  rn  r  rc  r  r  rb  r   )r/  r0  r1  r2  r3  r?  r   r6  r0   r  rQ   r   rR  r  r5  r}  r  r  rp  r  r  rq  r  r  rd  r  r  r  r8  r9  r:  s   @rL   r  r  ;  s     34  ?  ?D &%	 j*-F	 Y	*E	 j*-F	 Y	*E2'' 'rN   r  c                      ^  \ rS rSrSr\R                  SU 4S jj5       rS rS r	S r
\" \
\	5      rS rS r\" \\5      rS	 rS
 r\" \\5      rS rS rS rS r\" \\5      rS rS rS rSrU =r$ )Annulusi  z
An elliptical annulus.
c                 z   > [         TU ]  " S0 UD6  U R                  U5        Xl        X0l        X@l        SU l        g)a  
Parameters
----------
xy : (float, float)
    xy coordinates of annulus centre.
r : float or (float, float)
    The radius, or semi-axes:

    - If float: radius of the outer circle.
    - If two floats: semi-major and -minor axes of outer ellipse.
width : float
    Width (thickness) of the annular ring. The width is measured inward
    from the outer ellipse so that for the inner ellipse the semi-axes
    are given by ``r - width``. *width* must be less than or equal to
    the semi-minor axis.
angle : float, default: 0
    Rotation angle in degrees (anti-clockwise from the positive
    x-axis). Ignored for circular annuli (i.e., if *r* is a scalar).
**kwargs
    Keyword arguments control the `Patch` properties:

    %(Patch:kwdoc)s
Nrm  )r/   r0   	set_radiir}  rp  rd  r  )rI   r,  r>  rp  rd  rJ   rK   s         rL   r0   Annulus.__init__  s7    2 	"6"q


rN   c                     U R                   U R                  :X  a  U R                   nOU R                   U R                  4nS/ U R                  QUPU R                  PU R                  P7-  $ )Nz.Annulus(xy=(%s, %s), r=%s, width=%s, angle=%s))ar   r}  rp  rd  rI   r>  s     rL   r?  Annulus.__str__  s]    66TVVA A?9$++9q9$**9djj9: 	:rN   c                 ,    Xl         SU l        SU l        g)zK
Set the center of the annulus.

Parameters
----------
xy : (float, float)
NT)r  r  r   r  s     rL   rR  Annulus.set_center  s     

rN   c                     U R                   $ )z!Return the center of the annulus.r  r   s    rL   r  Annulus.get_center*  r  rN   c                     U[        U R                  U R                  5      :  a  [        S5      eXl        SU l        SU l        g)z
Set the width (thickness) of the annulus ring.

The width is measured inwards from the outer ellipse.

Parameters
----------
width : float
z>Width of annulus must be less than or equal to semi-minor axisNT)minr  r   rG  rb  r  r   r`  s     rL   r  Annulus.set_width0  sB     3tvvtvv&&PR R 

rN   c                     U R                   $ )z1Return the width (thickness) of the annulus ring.r  r   s    rL   r  Annulus.get_widthB  r   rN   c                 ,    Xl         SU l        SU l        g)zI
Set the tilt angle of the annulus.

Parameters
----------
angle : float
NT)r  r  r   r  s     rL   r  Annulus.set_angleH  s     

rN   c                     U R                   $ )z Return the angle of the annulus.r  r   s    rL   r  Annulus.get_angleT  r   rN   c                 @    [        U5      U l        SU l        SU l        g)zN
Set the semi-major axis *a* of the annulus.

Parameters
----------
a : float
NT)r   r  r  r   )rI   r  s     rL   set_semimajorAnnulus.set_semimajorZ       q

rN   c                 @    [        U5      U l        SU l        SU l        g)zN
Set the semi-minor axis *b* of the annulus.

Parameters
----------
b : float
NT)r   r   r  r   r   s     rL   set_semiminorAnnulus.set_semiminorf  r  rN   c                     [         R                  " U5      S:X  a  Uu  U l        U l        O=[         R                  " U5      S:X  a  [	        U5      =U l        U l        O[        S5      eSU l        SU l        g)a  
Set the semi-major (*a*) and semi-minor radii (*b*) of the annulus.

Parameters
----------
r : float or (float, float)
    The radius, or semi-axes:

    - If float: radius of the outer circle.
    - If two floats: semi-major and -minor axes of outer ellipse.
)r  rm  z(Parameter 'r' must be one or two floats.NT)rp   r5  r  r   r   rG  r  r   r  s     rL   r  Annulus.set_radiir  s]     88A;$NDFDFXXa[B#Ah&DFTVGHH

rN   c                 2    U R                   U R                  4$ )z:Return the semi-major and semi-minor radii of the annulus.)r  r   r   s    rL   	get_radiiAnnulus.get_radii  s    vvtvv~rN   c                    [         R                  " 5       R                  " U R                  X#45      6 R	                  U R
                  5      R                  " U R                  U R                  5      6 R                  U5      $ rd   )	r   r   r  r-  r  rd  rS  r}  r  )rI   r  r  r   s       rL   _transform_vertsAnnulus._transform_verts  so    ""$U**A624Z

#Y ..t{{;= Yu		rN   c                    [         R                  " SS5      nU R                  U R                  U R                  pCnU R                  UR                  X#5      nU R                  UR                  S S S2   X$-
  X4-
  5      n[        R                  " XVUSS S 24   S/5      n[        R                  " UR                  [         R                  UR                  SS  [         R                  [         R                  /5      n[        Xx5      U l        g )Nr   rG  r  r  r   )r   rI  r  r   rp  r  ro   rp   vstackhstackrn   rr   rJ  r  )	rI   rI  r  r   r   rL  rM  rN  r   s	            rL   rD  Annulus._recompute_path  s    hhq# &&$&&$**a""3<<6""3<<"#5quaeDIIrr!Q$x01IIsyy$++yy}dkk~~' ( !Z
rN   c                 T    U R                   c  U R                  5         U R                   $ rd   rc  r   s    rL   rQ   Annulus.get_path  re  rN   )
r  r  r  rb  r  rd  r   r}  r   rp  ri  )r/  r0  r1  r2  r3  r   r6  r0   r?  rR  r  r5  r}  r  r  rp  r  r  rd  r  r  r  r  radiir  rD  rQ   r8  r9  r:  s   @rL   r  r    s      @:
 j*-F$ Y	*E
 Y	*E

, Y	*E  rN   r  c                   r   ^  \ rS rSrSrS r\R                  SU 4S jj5       rS r	S r
\" \
\	5      rSrU =r$ )	Circlei  z
A circle patch.
c                 `    U R                   S   U R                   S   U R                  4nSnX!-  $ )Nr   r   zCircle(xy=(%g, %g), radius=%g))r}  r^   re  s      rL   r?  Circle.__str__  s/    {{1~t{{1~t{{:.zrN   c                 B   > [         TU ]  " XS-  US-  40 UD6  X l        g)z
Create a true circle at center *xy* = (*x*, *y*) with given *radius*.

Unlike `CirclePolygon` which is a polygonal approximation, this uses
Bezier splines and is much closer to a scale-free circle.

Valid keyword arguments are:

%(Patch:kwdoc)s
r  N)r/   r0   r^   )rI   r,  r^   rJ   rK   s       rL   r0   Circle.__init__  s&     	aZ!>v>rN   c                 4    SU-  =U l         U l        SU l        g)zE
Set the radius of the circle.

Parameters
----------
radius : float
r  TN)rp  rq  r   rV  s     rL   rW  Circle.set_radius  s     $%v:-
T[
rN   c                      U R                   S-  $ )z Return the radius of the circle.r~  rB  r   s    rL   
get_radiusCircle.get_radius  s    zzBrN   )rq  r^   r   rp  r  )r/  r0  r1  r2  r3  r?  r   r6  r0   rW  r  r5  r^   r8  r9  r:  s   @rL   r  r    s?    
  	 j*-FrN   r  c                      ^  \ rS rSrSrS r\R                  SSSS.U 4S jj5       r\	R                  S 5       rS	 rS
 rSrU =r$ )Arci  zl
An elliptical arc, i.e. a segment of an ellipse.

Due to internal optimizations, the arc cannot be filled.
c                     U R                   S   U R                   S   U R                  U R                  U R                  U R                  U R
                  4nSnX!-  $ )Nr   r   zEArc(xy=(%g, %g), width=%g, height=%g, angle=%g, theta1=%g, theta2=%g))r}  rp  rq  rd  r?  r@  re  s      rL   r?  Arc.__str__  sM    AA

TZZdkkC<zrN   ri  g     v@)rd  r?  r@  c                @  > UR                  SS5      nU(       a  [        S5      e[        T	U ]  " XU4SU0UD6  XPl        X`l        U R                  5       u  U l        U l        U l	        U l
        [        R                  " U R                  U R                  5      U l        g)a  
Parameters
----------
xy : (float, float)
    The center of the ellipse.

width : float
    The length of the horizontal axis.

height : float
    The length of the vertical axis.

angle : float
    Rotation of the ellipse in degrees (counterclockwise).

theta1, theta2 : float, default: 0, 360
    Starting and ending angles of the arc in degrees. These values
    are relative to *angle*, e.g. if *angle* = 45 and *theta1* = 90
    the absolute starting angle is 135.
    Default *theta1* = 0, *theta2* = 360, i.e. a complete ellipse.
    The arc is drawn in the counterclockwise direction.
    Angles greater than or equal to 360, or smaller than 0, are
    represented by an equivalent angle in the range [0, 360), by
    taking the input value mod 360.

Other Parameters
----------------
**kwargs : `~matplotlib.patches.Patch` properties
    Most `.Patch` properties are supported as keyword arguments,
    except *fill* and *facecolor* because filling is not supported.

%(Patch:kwdoc)s
r*   FzArc objects cannot be filledrd  N)
setdefaultrG  r/   r0   r?  r@  _theta_stretch_theta1_theta2_stretched_width_stretched_heightr   rI  r  )
rI   r,  rp  rq  rd  r?  r@  rJ   r*   rK   s
            rL   r0   Arc.__init__  s    H   /;<<FB%B6B#'#6#6#8	!t|T%:		XXdllDLL9
rN   c                 ^  ^ U R                  5       (       d  gU R                  5         U R                  5         U R                  5       nUR	                  U R
                  U R                  45      UR	                  S5      -
  u  p4SnX5:  a  XE:  a  [        R                  X5      $ S mU4S jn[        R                  " U R                  =(       d    U R                  SS9R                  5      U R                  5       -
  n[        R                   " 5       R#                  U5      n[%        5       n	['        UR(                  SS UR(                  S	S 5       H|  u  pU" / U
QUQ76 nUR*                  u  p[,        R.                  " [,        R0                  " X5      5      S
-   S
-  nU	R3                  XR4                  U:  XR6                  :  -     5        M~     [9        U	5      U R6                  /-   n	U R4                  n[,        R:                  " U R4                  5      nUR=                  [,        R>                  " U5      [,        R@                  " U5      45      nU RB                  nU	 HC  nU(       a5  [        RD                  " UUS5      U l!        [        R                  X5        SnOSnUnME     UU l!        g)a  
Draw the arc to the given *renderer*.

Notes
-----
Ellipses are normally drawn using an approximation that uses
eight cubic Bezier splines.  The error of this approximation
is 1.89818e-6, according to this unverified source:

  Lancaster, Don.  *Approximating a Circle or an Ellipse Using
  Four Bezier Cubic Splines.*

  https://www.tinaja.com/glib/ellipse4.pdf

There is a use case where very large ellipses must be drawn
with very high accuracy, and it is too expensive to render the
entire ellipse with enough segments (either splines or line
segments).  Therefore, in the case where either radius of the
ellipse is large enough that the error of the spline
approximation will be visible (greater than one pixel offset
from the ideal), a different technique is used.

In that case, only the visible parts of the ellipse are drawn,
with each visible arc using a fixed number of spline segments
(8).  The algorithm proceeds as follows:

1. The points where the ellipse intersects the axes (or figure)
   bounding box are located.  (This is done by performing an inverse
   transformation on the bbox such that it is relative to the unit
   circle -- this makes the intersection calculation much easier than
   doing rotated ellipse intersection directly.)

   This uses the "line intersecting a circle" algorithm from:

       Vince, John.  *Geometry for Computer Graphics: Formulae,
       Examples & Proofs.*  London: Springer-Verlag, 2005.

2. The angles of each of the intersection points are calculated.

3. Proceeding counterclockwise starting in the positive
   x-direction, each of the visible arc-segments between the
   pairs of vertices are drawn using the Bezier arc
   approximation technique implemented in `.Path.arc`.
Nr  g\!Ac                    X -
  nX1-
  nXD-  XU-  -   nX-  X!-  -
  nXw-  nXh-
  n	U	S:  a  [         R                  " SU5      n
[         R                  " U	5      n[         R                  " Xu-  X-  U-  -   U-  U* U-  [	        U5      U-  -   U-  /Xu-  X-  U-  -
  U-  U* U-  [	        U5      U-  -
  U-  //5      $ [         R
                  " S5      $ )Nri  r   r  )rp   copysignsqrtr  rH  r  )rw  rx  ry  rz  rn  ro  dr2DD2discrimsign_dysqrt_discrims               rL   line_circle_intersect'Arc.draw.<locals>.line_circle_intersectW  s    BB'BG#C"'!ABhG#~++a,!www/xxv| ;;sBrBwR<!773>@v| ;;sBrBwR<!773>@AB B xx''rN   c                    > SnX :  a  X peOXpeX1:  a  X1pOXpT" XX#5      n	U	R                   u  pU	XT-
  U
:  XU-   :  -  Xt-
  U:  -  XU-   :  -     $ )Ng&.>)T)rw  rx  ry  rz  epsilonx0ex1ey0ey1exysxsysr1  s               rL   segment_circle_intersect*Arc.draw.<locals>.segment_circle_intersecti  s~    GwSSwSS'7CUUFB#7](:;=2%'*,W}*<> rN   Frootr  r   rG     T)#r  r  r   r   r  r$  r%  r'   r  r   r  axes
get_figurer  rP   r   rt  transformedsetzipro   r4  rp   rad2degr{  rJ  r"  r#  sorteddeg2radre   cossinr  rI  )rI   r  data_to_screen_transpwidthpheight	inv_errorr=  box_path_transformbox_paththetasp0p1r,  rf   rg   theta
last_theta
theta1_radrx   path_originalr1  s                       @rL   r  Arc.draw  sP   \ !!!!#  $668 **D,A,A,0,B,B,D E **623 	 -	'"5::d--	($	* &&		(PT__%_5P'V'VW  "# 	 &&(445GH(++CR0(2C2CAB2GHFB)3233B44DA ZZ

1 01C73>EMM||e+0DEFH I 4<<.0\\
ZZ-
((VVJ
!34

 

E!XXj%;


4*J  #
rN   c           
      T   U R                  5       n[        S [        XR                  U R                  U R
                  U R                  45       5       5      (       aL  Uu  U l        U l        U l        U l        [        R                  " U R                  U R                  5      U l	        g g )Nc              3   .   #    U  H  u  pX:g  v   M     g 7frd   rm  )rh   r  r   s      rL   rk   #Arc._update_path.<locals>.<genexpr>  s      6 #5$!qv #5s   )
r!  ru   rF  r"  r#  r$  r%  r   rI  r  )rI   	stretcheds     rL   r   Arc._update_path  s    '')	 6#LL$,,8M8M 224#5 6 6 6 (1%T\4<)>#$,,=DJ6rN   c                    S nU R                  U R                  5      nU R                  U R                  5      nX#:w  ah  U R                  U R
                  :w  a   U R                  S-  U R
                  S-  :X  d.  U" U R                  X#-  5      nU" U R
                  X#-  5      nXEX#4$ U R                  U R
                  X#4$ )Nc                     [         R                  " U 5      n [         R                  " U 5      n[         R                  " U 5      n[         R                  " [         R
                  " X-  U5      5      nUS-   S-  $ )NrG  )rp   rI  rJ  rK  rG  r{  )rU  r  rf   rg   sthetas        rL   theta_stretch)Arc._theta_stretch.<locals>.theta_stretch  sT    JJu%EuAuAZZ

59a 89FSLC''rN   rG  )r*  rp  r+  rq  r?  r@  )rI   rb  rp  rq  r?  r@  s         rL   r!  Arc._theta_stretch  s    	( ##DJJ/$$T[[1 O [[DKK/[[3&$++*;;"4;;?F"4;;?F500{{DKK66rN   )r  r%  r$  r"  r#  r?  r@  )r/  r0  r1  r2  r3  r?  r   r6  r0   r
   r7  r  r   r!  r8  r9  r:  s   @rL   r  r    s[     3u-: -:^ L#  L#\>7 7rN   r  c           	         Uc  0 nUR                  5       nUR                  SS5      nUR                  U5      nU R                  " U5      n[	        UR
                  US-  -
  UR                  US-  -
  4UR                  U-   UR                  U-   U[        R                  " 5       SS9nUR                  U5        UR                  U5        g)a&  
A debug function to draw a rectangle around the bounding
box returned by an artist's `.Artist.get_window_extent`
to test whether the artist is returning the correct bbox.

*props* is a dict of rectangle props with the additional property
'pad' that sets the padding around the bbox in points.
Npad   r  F)r,  rp  rq  r*   r  clip_on)copypoprQ  r'  r^  rw  rx  rp  rq  r   r   rJ  r  )r
   r  propsr*   rf  r  r>  s          rL   bbox_artistrl    s     }JJLE
))E1
C

#
#C
(C##H-DGGcAgtwwq01jj3t{{S'8Z99;U	LA HHUOFF8rN   c           	          [        U R                  U R                  U R                  USSS9nUb  UR	                  U5        UR                  U5        g)z
A debug function to draw a rectangle around the bounding
box returned by an artist's `.Artist.get_window_extent`
to test whether the artist is returning the correct bbox.
F)r,  rp  rq  r"   r*   rh  N)r^  rS  rp  rq  r   r  )r  r  r)   rS   r>  s        rL   	draw_bboxrn    sE     	TWWDJJt{{!u	>A	FF8rN   c                   ~    \ rS rSrSrS rS r\S 5       r\S 5       r	\\
R                  " SSS	S
9S 5       5       rSrg)_Stylei  z
A base class for the Styles. It is meant to be a container class,
where actual styles are declared as subclass of it, and it
provides some helper functions.
c                 $   [         R                  R                  " S0 U R                   S3U R	                  5       U R                   S3U R	                  5       S-   SR                  [        SR                  U R                  5      5      -   S-   0D6  g )Nz:tablez:table_and_acceptsz

    .. ACCEPTS: [|z '{}' ]rm  )	r   r6  registerr/  pprint_stylesjoinrs   format_style_listclss    rL   __init_subclass___Style.__init_subclass__  s     	## 	||nF#S%6%6%8||n./!!#)*((3x@AB '
 	rN   c                    UR                  SS5      R                  S5      nUS   R                  5       n U R                  U   n USS  Vs/ s H  owR                  S5      PM     nnU V	V
s0 s H  u  pU	[        U
5      _M     nn	n
U" S
0 0 UEUED6$ ! [         a  n[        SU< 35      UeSnAff = fs  snf s  sn
n	f ! [
         a  n[        S	U< 35      UeSnAff = f)z>Return the instance of the subclass with the given style name.r   r   ,r   zUnknown style: Nr   =zIncorrect style argument: rm  )replacert   lowerrx  KeyErrorrG  r   )rz  	stylenamerJ   _list_name_clserrr   
_args_pairkrN  _argss               rL   __new___Style.__new__	  s     !!#r*005a 	G??5)D	E27)<)B((3-)J<-78ZTQQa[ZE8 *))&)**  	Gym<=3F	G =8 	E,YM:<ADE	EsM   B C B7'C .B<C 
B4B//B47C 
C!CC!c                     U R                   $ )z(Return a dictionary of available styles.)rx  ry  s    rL   
get_styles_Style.get_styles	  s     rN   c                    S/U R                   R                  5        VV s/ s HA  u  pU R                  SU S3[        [        R
                  " U 5      5      SS =(       d    S4PMC     sn nQn[        U6  Vs/ s H  n[        S U 5       5      PM     nnSR                  S U 5       5      nS	R                  S
USR                  S [        US   U5       5       5      U/USS  Vs/ s H$  nSR                  S [        Xd5       5       5      PM&     snQUP5      n[        R                  " USS9$ s  sn nf s  snf s  snf )z5Return the available styles as pretty-printed string.)ClassNameAttrsz``r   r  r   c              3   8   #    U  H  n[        U5      v   M     g 7frd   )rG   )rh   cells     rL   rk   '_Style.pprint_styles.<locals>.<genexpr>*	  s     4VTs4yyVs   z  c              3   ,   #    U  H
  nS U-  v   M     g7f)r  Nrm  )rh   cls     rL   rk   r  +	  s     #?wC"Hws   r  r   c              3   H   #    U  H  u  pUR                  U5      v   M     g 7frd   ljustrh   r  r  s      rL   rk   r  /	  s     L5Kdjjnn5K    "r   Nc              3   H   #    U  H  u  pUR                  U5      v   M     g 7frd   r  r  s      rL   rk   r  1	  s     I7H84

27Hr  z    )prefix)rx  itemsr/  strinspect	signaturerF  maxrv  textwrapindent)rz  r   tablecolumncol_lentable_formatstrrow	rst_tables           rL   ru  _Style.pprint_styles	  sT    , > %(OO$9$9$;=
 %<yt LLbM))#./"5?	A
 %<=> DG;O;34V44;O))#?w#??IIIILSq75KLL	
 qr$"# iiIs37HII"$
 
 	 y99%= P$s   AD17D7'+D<
z3.10.0z%This method is never used internally.z6No replacement.  Please open an issue if you use this.)messagealternativec                     [        X R                  5      (       d  [        U SU R                   35      eX R                  U'   g)zRegister a new style.z must be a subclass of N)
issubclass_BaserG  rx  )rz  r   styles      rL   rt  _Style.register7	  s:     %++w&=cii[IJJ %rN   rm  N)r/  r0  r1  r2  r3  r{  r  classmethodr  ru  r	   
deprecatedrt  r8  rm  rN   rL   rp  rp    sg    &+$   : :. 	__7L
& &rN   rp  r   c                    Uc  [         R                  " [        XS9$ XU=(       d    UR                  R	                  5       '   U$ )z=Class decorator that stashes a class in a (style) dictionary.r  )	functoolspartial_register_styler/  r  )
style_listrz  r   s      rL   r  r  D	  s9    
{  *HH/2t+s||))+,JrN   c                      \ rS rSrSr0 r\" \5       " S S5      5       r\" \5       " S S5      5       r\" \5       " S S5      5       r	\" \5       " S	 S
5      5       r
\" \5       " S S\
5      5       r\" \5       " S S5      5       r\" \5       " S S5      5       r\" \5       " S S5      5       r\" \5       " S S5      5       r\" \5       " S S\5      5       rSrg)BoxStyleiL	  aj  
`BoxStyle` is a container class which defines several
boxstyle classes, which are used for `FancyBboxPatch`.

A style object can be created as::

       BoxStyle.Round(pad=0.2)

or::

       BoxStyle("Round", pad=0.2)

or::

       BoxStyle("Round, pad=0.2")

The following boxstyle classes are defined.

%(BoxStyle:table)s

An instance of a boxstyle class is a callable object, with the signature ::

   __call__(self, x0, y0, width, height, mutation_size) -> Path

*x0*, *y0*, *width* and *height* specify the location and size of the box
to be drawn; *mutation_size* scales the outline properties such as padding.
c                   (    \ rS rSrSrSS jrS rSrg)BoxStyle.Squareil	  zA square box.c                     Xl         gzd
Parameters
----------
pad : float, default: 0.3
    The amount of padding around the original box.
Nrf  rI   rf  s     rL   r0   BoxStyle.Square.__init__p	  	     HrN   c                     XPR                   -  nUSU-  -   USU-  -   pCX-
  X&-
  p!X-   X$-   p[        R                  " X4Xr4Xx4X4/5      $ Nr  rf  r   r~  )	rI   rw  rx  rp  rq  mutation_sizerf  ry  rz  s	            rL   __call__BoxStyle.Square.__call__y	  sc    ((*C!AGOVa#g-=6XrxZ&&B8bXx8: :rN   r  Nrl  r/  r0  r1  r2  r3  r0   r  r8  rm  rN   rL   Squarer  l	  s    		:rN   r  c                   (    \ rS rSrSrSS jrS rSrg)BoxStyle.Circlei	  zA circular box.c                     Xl         gr  r  r  s     rL   r0   BoxStyle.Circle.__init__	  r  rN   c                     XPR                   -  nUSU-  -   USU-  -   pCX-
  X&-
  p![        R                  " XS-  -   X$S-  -   4[        X45      S-  5      $ r  )rf  r   circler  )rI   rw  rx  rp  rq  r  rf  s          rL   r  BoxStyle.Circle.__call__	  sb    ((*C!AGOVa#g-=6Xrx;;QYaZ@ #E 2Q 68 8rN   r  Nr  r  rm  rN   rL   r  r  	  s    		8rN   r  c                   (    \ rS rSrSrSS jrS rSrg)BoxStyle.Ellipsei	  z+
An elliptical box.

.. versionadded:: 3.7
c                     Xl         gr  r  r  s     rL   r0   BoxStyle.Ellipse.__init__	  r  rN   c                 \   XPR                   -  nUSU-  -   USU-  -   pCX-
  X&-
  p!U[        R                  " S5      -  nU[        R                  " S5      -  n[        5       R	                  Xx5      R                  XS-  -   X$S-  -   5      n	U	R                  [        R                  " 5       5      $ r  )	rf  mathr*  r   r  rS  transform_pathr   r  )
rI   rw  rx  rp  rq  r  rf  r  r   rS   s
             rL   r  BoxStyle.Ellipse.__call__	  s    ((*C!AGOVa#g-=6Xrx		!$A1%AJ$$Q*44R!)^571*_FE''(8(8(:;;rN   r  Nr  r  rm  rN   rL   r  r  	  s    				<rN   r  c                   (    \ rS rSrSrSS jrS rSrg)BoxStyle.LArrowi	  z,A box in the shape of a left-pointing arrow.c                     Xl         gr  r  r  s     rL   r0   BoxStyle.LArrow.__init__	  r  rN   c                     XPR                   -  nUSU-  -   USU-  -   pCX-
  X&-
  p!X-   X$-   pX-
  S-  n	U	S-  n
XS-  -   n[        R                  " X-   U4Xr4Xx4X-   U4X-   X-   4X-
  X)-   4X-   X*-
  4X-   U4/5      $ Nr  gffffff?r  rI   rw  rx  rp  rq  r  rf  ry  rz  rn  dxxs              rL   r  BoxStyle.LArrow.__call__	  s    ((*C!AGOVa#g-=6XrxZ'QBq&CCiB&&(B"B8bh^(BH%'9(BH%(B!" "rN   r  Nr  r  rm  rN   rL   LArrowr  	  s    :		"rN   r  c                       \ rS rSrSrS rSrg)BoxStyle.RArrowi	  z-A box in the shape of a right-pointing arrow.c                     [         R                  R                  XX#XE5      nSU-  U-   UR                  S S 2S4   -
  UR                  S S 2S4'   U$ )Nr  r   )r  r  r  ro   )rI   rw  rx  rp  rq  r  ps          rL   r  BoxStyle.RArrow.__call__	  sN    (("V<A 2v~

1a40@@AJJq!tHrN   rm  Nr/  r0  r1  r2  r3  r  r8  rm  rN   rL   RArrowr  	  s
    ;	rN   r  c                   (    \ rS rSrSrSS jrS rSrg)BoxStyle.DArrowi	  z&A box in the shape of a two-way arrow.c                     Xl         gr  r  r  s     rL   r0   BoxStyle.DArrow.__init__	  r  rN   c                    XPR                   -  nUSU-  -   nX-
  X&-
  p!X-   X$-   pX-
  S-  n	U	S-  n
XS-  -   n[        R                  " X-   U4Xr4XrU
-
  4Xy-   U
-   X)-   4XxU
-   4Xx4X-   U4X-   X-   4X-
  X)-   4X-   X*-
  4X-   U4/5      $ r  r  r  s              rL   r  BoxStyle.DArrow.__call__	  s    ((*C a#g%FXrxZ'QBq&CCiB&&2#X3 8#X28R.28$rw&828$2(  ! !rN   r  Nr  r  rm  rN   rL   DArrowr  	  s    4		!rN   r  c                   (    \ rS rSrSrSS jrS rSrg)BoxStyle.Roundi
  zA box with round corners.Nc                     Xl         X l        g)z
Parameters
----------
pad : float, default: 0.3
    The amount of padding around the original box.
rounding_size : float, default: *pad*
    Radius of the corners.
Nrf  rounding_sizerI   rf  r  s      rL   r0   BoxStyle.Round.__init__
       H!.rN   c                    XPR                   -  nU R                  (       a  XPR                  -  nOUnUSU-  -   USU-  -   pCX-
  X&-
  p!X-   X$-   pX-   U4X-
  U4X4XU-   4XU-
  4X4X-
  U	4X-   U	4X4XU-
  4XU-   4X4X-   U4X-   U4/n
[        R                  [        R                  [        R
                  [        R
                  [        R                  [        R
                  [        R
                  [        R                  [        R
                  [        R
                  [        R                  [        R
                  [        R
                  [        R                  /n[        X5      $ r  )rf  r  r   rr   r  CURVE3rJ  rI   rw  rx  rp  rq  r  rf  drry  rz  cpcoms               rL   r  BoxStyle.Round.__call__
  sB     ((*C !!"%7%77!AGOVa#g-=6XrxZ 7B-7B-(RbMBw-(RWbM7B-(RbMBw-(RWbM7B-	!B ;;;;;;;;;;;;;;;;;;>>	#C = rN   r  rl  Nr  rm  rN   rL   Roundr  
  s    '
	/(	!rN   r  c                   (    \ rS rSrSrSS jrS rSrg)BoxStyle.Round4i=
  zA box with rounded edges.Nc                     Xl         X l        g)z
Parameters
----------
pad : float, default: 0.3
    The amount of padding around the original box.
rounding_size : float, default: *pad*/2
    Rounding of edges.
Nr  r  s      rL   r0   BoxStyle.Round4.__init__A
  r  rN   c                    XPR                   -  nU R                  (       a  XPR                  -  nOUS-  nUSU-  -   SU-  -
  nUSU-  -   SU-  -
  nX-
  U-   X&-
  U-   p!X-   X$-   pX4X-   X'-
  4X-
  X'-
  4X4X-   X'-   4X-   X-
  4X4X-
  X-   4X-   X-   4X4X-
  X-
  4X-
  X'-   4X4X4/n
[        R                  [        R                  [        R                  [        R                  [        R                  [        R                  [        R                  [        R                  [        R                  [        R                  [        R                  [        R                  [        R                  [        R
                  /n[        X5      $ )Nr~  r  )rf  r  r   rr   CURVE4rJ  r  s               rL   r  BoxStyle.Round4.__call__M
  si     ((*C !!"%7%772XAGOa"f,Ea#g%B.FX]BHrMZ(7BG$rw&82(7BG$rw&82(7BG$rw&82(7BG$rw&82((B ;;;;T[[;;T[[;;T[[;;T[[>>#C = rN   r  r  r  rm  rN   rL   Round4r	  =
  s    '
	/	!rN   r  c                   .    \ rS rSrSrSS jrS rS rSrg)	BoxStyle.Sawtoothin
  zA box with a sawtooth outline.Nc                     Xl         X l        g)z
Parameters
----------
pad : float, default: 0.3
    The amount of padding around the original box.
tooth_size : float, default: *pad*/2
    Size of the sawtooth.
Nrf  
tooth_size)rI   rf  r  s      rL   r0   BoxStyle.Sawtooth.__init__r
  s     H(OrN   c                 6   XPR                   -  nU R                  c  U R                   S-  U-  nOU R                  U-  nUS-  nUSU-  -   U-
  nUSU-  -   U-
  n[        X7-
  US-  -  5      S-  n	[        XG-
  US-  -  5      S-  n
X-
  U-   X&-
  U-   p!X-   X$-   pU/[        R                  " X-   X-
  SU	-  S-   5      QXU-   XU-
  /U
-  S SU
-  S-    QUP[        R                  " X-
  X-   SU	-  S-   5      QXU-
  XU-   /U
-  S SU
-  S-    Qn/ X"U-
  X"U-   /U	-  S SU	-  S-    QUP[        R                  " X(-   X-
  SU
-  S-   5      QXU-   XU-
  /U	-  S SU	-  S-    QUP[        R                  " X-
  X(-   SU
-  S-   5      Qn/ [        X5      QUS   US   4P$ )NrC  r  r   r   )rf  r  roundrp   linspacerF  )rI   rw  rx  rp  rq  r  rf  r  hszdsx_ndsy_nry  rz  r;  r<  s                  rL   _get_sawtooth_vertices(BoxStyle.Sawtooth._get_sawtooth_vertices~
  sA     ((*C &!XX]]:
!__}<
q.CAGOj0Ea#g%
2F 5-*q.ABQFE6.:>BCaGEX^RX^Z [[28QY]CCx#X.6
5C  [[28QY]C Cx#X.6
5C	BCx#X.6
5C[[28QY]C Cx#X.6
5C 	 [[28QY]C	B 2S[12a5"Q%.11rN   c                 <    U R                  XUXE5      n[        USS9$ )NTr%  )r  r   )rI   rw  rx  rp  rq  r  saw_verticess          rL   r  BoxStyle.Sawtooth.__call__
  s'    66ru7=NLT22rN   r  r  )	r/  r0  r1  r2  r3  r0   r  r  r8  rm  rN   rL   Sawtoothr  n
  s    ,
	)$	2L	3rN   r!  c                       \ rS rSrSrS rSrg)BoxStyle.Roundtoothi
  z&A box with a rounded sawtooth outline.c                     U R                  XX4U5      n[        R                  " XfS   //5      n[        R                  /[        R
                  [        R
                  /[        U5      S-
  S-  -  -   [        R                  /-   n[        Xg5      $ )Nr   r   r  )r  rp   r  r   rr   r   rG   rJ  )rI   rw  rx  rp  rq  r  r  rn   s           rL   r  BoxStyle.Roundtooth.__call__
  s    66r7<7DFL >><q/9J*KLLkk]kk4;;/C4Ea4G!3KLMnn%&E ,,rN   rm  Nr  rm  rN   rL   
Roundtoothr#  
  s
    4		-rN   r&  rm  N)r/  r0  r1  r2  r3  rx  r  r  r  r  r  r  r  r  r  r!  r&  r8  rm  rN   rL   r  r  L	  s@   8 K[!: : ":, [!8 8 "8( [!< < "<6 [!" " ""> [!  " [!"! "! ""!H [!7! 7! "7!r [!.! .! ".!` [!83 83 "83t [!-X - "-rN   r  c                      \ rS rSrSr0 r " S S5      r\" \5       " S S\5      5       r\" \5       " S S\5      5       r	\" \5       " S	 S
\5      5       r
\" \5       " S S\5      5       r\" \5       " S S\5      5       rSrg)ConnectionStylei
  a  
`ConnectionStyle` is a container class which defines
several connectionstyle classes, which is used to create a path
between two points.  These are mainly used with `FancyArrowPatch`.

A connectionstyle object can be either created as::

       ConnectionStyle.Arc3(rad=0.2)

or::

       ConnectionStyle("Arc3", rad=0.2)

or::

       ConnectionStyle("Arc3, rad=0.2")

The following classes are defined

%(ConnectionStyle:table)s

An instance of any connection style class is a callable object,
whose call signature is::

    __call__(self, posA, posB,
             patchA=None, patchB=None,
             shrinkA=2., shrinkB=2.)

and it returns a `.Path` instance. *posA* and *posB* are
tuples of (x, y) coordinates of the two points to be
connected. *patchA* (or *patchB*) is given, the returned path is
clipped so that it start (or end) from the boundary of the
patch. The path is further shrunk by *shrinkA* (or *shrinkB*)
which is given in points.
c                   0    \ rS rSrSrS rS r SS jrSrg)	ConnectionStyle._Basei
  aS  
A base class for connectionstyle classes. The subclass needs
to implement a *connect* method whose call signature is::

  connect(posA, posB)

where posA and posB are tuples of x, y coordinates to be
connected.  The method needs to return a path connecting two
points. This base class defines a __call__ method, and a few
helper methods.
c                    ^ U4S j$ )zS
Return a predicate function testing whether a point *xy* is
contained in *patch*.
c                 H   > TR                  [        U S   U S   S95      S   $ )Nr   r   )rf   rg   )ry   r   )r,  r   s    rL   <lambda>1ConnectionStyle._Base._in_patch.<locals>.<lambda>
  s(    enn"Q%2a513346rN   rm  )rI   r   s    `rL   	_in_patchConnectionStyle._Base._in_patch
  s    
6 6rN   c                     U(       a   [        X5      u  pAU(       a   [        X5      u  pU$ U$ ! [         a     N%f = f! [         a     U$ f = f)z
Clip *path* at its start by the region where *in_start* returns
True, and at its stop by the region where *in_stop* returns True.

The original path is assumed to start in the *in_start* region and
to stop in the *in_stop* region.
)r   rG  )rI   rT   in_startin_stopr8  s        rL   _clipConnectionStyle._Base._clip
  se     .t>GA .t=GD K4K " 
 " Ks   / ? 
<<
AANc           	      d   U R                  X5      nU R                  UU(       a  U R                  U5      OSU(       a  U R                  U5      OS5      nU R                  UU(       a  [        / UR                  S   QUP76 OSU(       a   [        / UR                  S   QUP76 5      nU$ S5      nU$ )zf
Call the *connect* method to create a path between *posA* and
*posB*; then clip and shrink the path.
Nr   r  )connectr4  r/  r   ro   )rI   posAposBshrinkAshrinkBpatchApatchBrT   s           rL   r  ConnectionStyle._Base.__call__	  s     <<+D::*0v&d*0v&dD
 ::=D9t}}Q/99$>E:t}}R0:':D
 K LPD
 KrN   rm  )r~  r~  NN)	r/  r0  r1  r2  r3  r/  r4  r  r8  rm  rN   rL   r  r*  
  s    
		6	* BF	rN   r  c                   (    \ rS rSrSrSS jrS rSrg)ConnectionStyle.Arc3i  u  
Creates a simple quadratic Bézier curve between two
points. The curve is created so that the middle control point
(C1) is located at the same distance from the start (C0) and
end points(C2) and the distance of the C1 to the line
connecting C0-C2 is *rad* times the distance of C0-C2.
c                     Xl         g)z=
Parameters
----------
rad : float
  Curvature of the curve.
Nrad)rI   rC  s     rL   r0   ConnectionStyle.Arc3.__init__&  r  rN   c                     Uu  p4Uu  pVX5-   S-  XF-   S-  pXS-
  Xd-
  pU R                   nX{U
-  -   XU	-  -
  pX44X4XV4/n[        R                  [        R                  [        R                  /n[        X5      $ )Nr~  )rC  r   rr   r   )rI   r8  r9  ry  rz  x2y2x12y12rn  ro  fr  cyro   rn   s                   rL   r7  ConnectionStyle.Arc3.connect/  s    FBFB2~2~WbgAr6\3R<"H [[[[[["E ((rN   rB  Nr  r/  r0  r1  r2  r3  r0   r7  r8  rm  rN   rL   Arc3r@    s    			)rN   rN  c                   (    \ rS rSrSrSS jrS rSrg)ConnectionStyle.Angle3iB  u   
Creates a simple quadratic Bézier curve between two points. The middle
control point is placed at the intersecting point of two lines which
cross the start and end point, and have a slope of *angleA* and
*angleB*, respectively.
c                     Xl         X l        g)zp
Parameters
----------
angleA : float
  Starting angle of the path.

angleB : float
  Ending angle of the path.
NangleAangleB)rI   rS  rT  s      rL   r0   ConnectionStyle.Angle3.__init__K  s     !K KrN   c           
      V   Uu  p4Uu  pV[         R                  " [         R                  " U R                  5      5      n[         R                  " [         R                  " U R                  5      5      n[         R                  " [         R                  " U R
                  5      5      n	[         R                  " [         R                  " U R
                  5      5      n
[        X4XxXVX5      u  pX44X4XV4/n[        R                  [        R                  [        R                  /n[        X5      $ rd   )
r  rJ  radiansrS  rK  rT  r   r   rr   r   )rI   r8  r9  ry  rz  rF  rG  cosAsinAcosBsinBr  rK  ro   rn   s                  rL   r7  ConnectionStyle.Angle3.connectY  s    FBFB88DLL56D88DLL56D88DLL56D88DLL56D%bd&(d:FB 2(RH5H[[$++t{{;E((rN   rR  N)Z   r   rM  rm  rN   rL   Angle3rP  B  s    		!	)rN   r^  c                   (    \ rS rSrSrSS jrS rSrg)ConnectionStyle.Angleij  u-  
Creates a piecewise continuous quadratic Bézier path between two
points. The path has a one passing-through point placed at the
intersecting point of two lines which cross the start and end point,
and have a slope of *angleA* and *angleB*, respectively.
The connecting edges are rounded with *rad*.
c                 (    Xl         X l        X0l        g)z
Parameters
----------
angleA : float
  Starting angle of the path.

angleB : float
  Ending angle of the path.

rad : float
  Rounding radius of the edge.
NrS  rT  rC  )rI   rS  rT  rC  s       rL   r0   ConnectionStyle.Angle.__init__t  s     !K KHrN   c           
         Uu  p4Uu  pV[         R                  " [         R                  " U R                  5      5      n[         R                  " [         R                  " U R                  5      5      n[         R                  " [         R                  " U R
                  5      5      n	[         R                  " [         R                  " U R
                  5      5      n
[        X4XxXVX5      u  pX44/n[        R                  /nU R                  S:X  a2  UR                  X45        UR                  [        R                  5        OX;-
  XL-
  nn[        R                  " UU5      nU R                  U-  nX[-
  Xl-
  nn[        R                  " UU5      nU R                  U-  nUR                  XU-  -   UUU-  -   4X4UUU-  -   UUU-  -   4/5        UR                  [        R                  [        R                  [        R                  /5        UR                  XV45        UR                  [        R                  5        [        X5      $ )Nri  )r  rJ  rW  rS  rK  rT  r   r   rr   rC  r  r  rp   rz  extendr   )rI   r8  r9  ry  rz  rF  rG  rX  rY  rZ  r[  r  rK  ro   rn   dx1dy1d1f1dx2dy2d2f2s                          rL   r7  ConnectionStyle.Angle.connect  s   FBFB88DLL56D88DLL56D88DLL56D88DLL56D%bd&(d:FB zH[[MExx2~)T[[)7BGSXXc3'XX]7BGSXXc3'XX]"Rx-cBh!?"$"$sRx-cBh!?!A B dkk4;;DEOORH%LL%((rN   rb  N)r]  r   ri  rM  rm  rN   rL   Angler`  j  s    		&!	)rN   ro  c                   (    \ rS rSrSrSS jrS rSrg)ConnectionStyle.Arci  u  
Creates a piecewise continuous quadratic Bézier path between two
points. The path can have two passing-through points, a
point placed at the distance of *armA* and angle of *angleA* from
point A, another point with respect to point B. The edges are
rounded with *rad*.
Nc                 @    Xl         X l        X0l        X@l        XPl        g)a  
Parameters
----------
angleA : float
  Starting angle of the path.

angleB : float
  Ending angle of the path.

armA : float or None
  Length of the starting arm.

armB : float or None
  Length of the ending arm.

rad : float
  Rounding radius of the edges.
NrS  rT  armAarmBrC  )rI   rS  rT  rt  ru  rC  s         rL   r0   ConnectionStyle.Arc.__init__  s    ( !K KIIHrN   c                    Uu  p4Uu  pVX44/n/ n[         R                  /n	U R                  (       a  [        R                  " [        R
                  " U R                  5      5      n
[        R                  " [        R
                  " U R                  5      5      nU R                  U R                  -
  nUR                  X<U
-  -   XLU-  -   45        U R                  nUR                  X<U
-  -   XLU-  -   45        U R                  (       Ga  [        R                  " [        R
                  " U R                  5      5      n[        R                  " [        R
                  " U R                  5      5      nXPR                  U-  -   X`R                  U-  -   nnU(       a  US   u  nnUU-
  UU-
  nnUU-  UU-  -   S-  nUR                  UU R                  U-  U-  -   UU R                  U-  U-  -   45        UR                  U5        U	R                  [         R                  [         R                  [         R                  /5        O US   u  nnUU-
  UU-
  nnUU-  UU-  -   S-  nUU R                  -
  nUUU-  U-  -   UUU-  U-  -   4UU4/nU(       a  US   u  nnUU-
  UU-
  nnUU-  UU-  -   S-  nUR                  UU R                  U-  U-  -   UU R                  U-  U-  -   45        UR                  U5        U	R                  [         R                  [         R                  [         R                  /5        UR                  XV45        U	R                  [         R                  5        [        Xy5      $ )Nr  rC  )r   rr   rt  r  rJ  rW  rS  rK  rC  r  ru  rT  re  r  r   )rI   r8  r9  ry  rz  rF  rG  ro   roundedrn   rX  rY  drZ  r[  x_armBy_armBxpyprn  ro  dds                         rL   r7  ConnectionStyle.Arc.connect  s   FBFBzHG[[MEyyxxT[[ 9:xxT[[ 9:II(XrH}=>IIXrH}=>yyyxxT[[ 9:xxT[[ 9:!#ii$&6!6YY=M8M$R[FB#b[&2+Br'BG+2BNNBB);$;$&B);$;$= >OOG,LL$++"&++"&++"/ 0 &b\FB#b[&2+Br'BG+2BMR",b1r6B;.>?"F+-  Bb"r'B2gR'B.TXX]R%7 7 "TXX]R%7 7 9 :(dkk"kk"kk+ , OORH%LL%((rN   rs  )r   r   NNri  rM  rm  rN   rL   r  rq    s    		69	)rN   r  c                   (    \ rS rSrSrSS jrS rSrg)ConnectionStyle.Bari
  z
A line with *angle* between A and B with *armA* and *armB*. One of the
arms is extended so that they are connected in a right angle. The
length of *armA* is determined by (*armA* + *fraction* x AB distance).
Same for *armB*.
Nc                 4    Xl         X l        X0l        X@l        g)a/  
Parameters
----------
armA : float
    Minimum length of armA.

armB : float
    Minimum length of armB.

fraction : float
    A fraction of the distance between two points that will be
    added to armA and armB.

angle : float or None
    Angle of the connecting line (if None, parallel to A and B).
N)rt  ru  fractionrd  )rI   rt  ru  r  rd  s        rL   r0   ConnectionStyle.Bar.__init__  s    " II$MJrN   c                 T   Uu  p4U=u  pVu  px[         R                  " X-
  Xs-
  5      n	Xs-
  X-
  pX-  X-  -   S-  nX-  X-  pU R                  U R                  nnU R                  b  [
        R                  " U R                  5      nU	U-
  nU[         R                  " U5      -  nU[         R                  " U5      -  nUU[         R                  " U5      -  -   UU[         R                  " U5      -  -   pUU-
  nXs-
  X-
  pX-  X-  -   S-  nU
U-  UU-  p[        UU5      nU R                  U-  U-   nUUU-  -   UUU-  -
  nnUUU-  -   UUU-  -
  nnX44UU4UU4XV4/n[        R                  [        R                  [        R                  [        R                  /n[        UU5      $ )NrC  )r  atan2rt  ru  rd  rp   rI  rK  rJ  r  r  r   rr   r  )rI   r8  r9  ry  rz  x20y20rF  rG  r?  rn  ro  r~  ddxddyrt  ru  theta0dthetadldLdd2armrJ  cx1cy1cx2cy2ro   rn   s                                 rL   r7  ConnectionStyle.Bar.connect)  s   FB $$HCvrZZ1FWbg'BG#*BwDII$Dzz%DJJ/&$((6**$((6**b488F#333R"txx?O:O5OBby "'Bw(R/8R#XSdD/C"S(AAG|R!c'\CAG|R!c'\Cc
c

$H [[[[[[[["E
 %((rN   )rd  rt  ru  r  )ri  ri  rl  NrM  rm  rN   rL   Barr  
  s    		,'	)rN   r  rm  N)r/  r0  r1  r2  r3  rx  r  r  rN  r^  ro  r  r  r8  rm  rN   rL   r(  r(  
  s    "H K9 9v [!#)u #) "#)J [!%) %) "%)N [!=) =) "=)~ [!])e ]) "])~ [!E)e E) "E)rN   r(  c                 N    X-
  X-
  peXEU-  Xf-  -   S-  -  nXU-  -
  XU-  -
  pX4$ )zo
Return the point on the line connecting (*x0*, *y0*) -- (*x1*, *y1*) whose
distance from (*x0*, *y0*) is *d*.
rC  rm  )
rw  rx  ry  rz  ry  rn  ro  ffrF  rG  s
             rL   _point_along_a_liner  S  sA    
 Wbg	
2gB&	&Br'\2R<6MrN   c                      \ rS rSrSr0 r " S S5      r " S S\5      r\" \SS9 " S	 S
\5      5       r	\" \SS9 " S S\5      5       r
\" \SS9 " S S\5      5       r\" \SS9 " S S\5      5       r\" \SS9 " S S\5      5       r\" \SS9 " S S\5      5       r\" \SS9 " S S\5      5       r\" \SS9 " S S\5      5       r\" \S S9 " S! S"\5      5       r\" \S#S9 " S$ S%\5      5       r\" \S&S9 " S' S(\5      5       r\" \S)S9 " S* S+\5      5       r\" \S,S9 " S- S.\5      5       r\" \5       " S/ S0\5      5       r\" \5       " S1 S2\5      5       r\" \5       " S3 S4\5      5       rS5rg6)7
ArrowStylei_  a  
`ArrowStyle` is a container class which defines several
arrowstyle classes, which is used to create an arrow path along a
given path.  These are mainly used with `FancyArrowPatch`.

An arrowstyle object can be either created as::

       ArrowStyle.Fancy(head_length=.4, head_width=.4, tail_width=.4)

or::

       ArrowStyle("Fancy", head_length=.4, head_width=.4, tail_width=.4)

or::

       ArrowStyle("Fancy, head_length=.4, head_width=.4, tail_width=.4")

The following classes are defined

%(ArrowStyle:table)s

For an overview of the visual appearance, see
:doc:`/gallery/text_labels_and_annotations/fancyarrow_demo`.

An instance of any arrow style class is a callable object,
whose call signature is::

    __call__(self, path, mutation_size, linewidth, aspect_ratio=1.)

and it returns a tuple of a `.Path` instance and a boolean
value. *path* is a `.Path` instance along which the arrow
will be drawn. *mutation_size* and *aspect_ratio* have the same
meaning as in `BoxStyle`. *linewidth* is a line width to be
stroked. This is meant to be used to correct the location of the
head so that it does not overshoot the destination point, but not all
classes support it.

Notes
-----
*angleA* and *angleB* specify the orientation of the bracket, as either a
clockwise or counterclockwise angle depending on the arrow type. 0 degrees
means perpendicular to the line connecting the arrow's head and tail.

.. plot:: gallery/text_labels_and_annotations/angles_on_bracket_arrows.py
c                   :    \ rS rSrSr\S 5       rS r SS jrSr	g)	ArrowStyle._Basei  a  
Arrow Transmuter Base class

ArrowTransmuterBase and its derivatives are used to make a fancy
arrow around a given path. The __call__ method returns a path
(which will be used to create a PathPatch instance) and a boolean
value indicating the path is open therefore is not fillable.  This
class is not an artist and actual drawing of the fancy arrow is
done by the FancyArrowPatch class.
c                     [        U R                  5       5      n[        U5      S:w  d4  US   S   [        R                  :w  d  US   S   [        R
                  :w  a  [        S5      e/ US   S   QUS   S   Q$ )u
  
Some ArrowStyle classes only works with a simple quadratic
Bézier curve (created with `.ConnectionStyle.Arc3` or
`.ConnectionStyle.Angle3`). This static method checks if the
provided path is a simple quadratic Bézier curve and returns its
control points if true.
r  r   r   z,'path' is not a valid quadratic Bezier curve)listiter_segmentsrG   r   rr   r   rG  )rT   segmentss     rL   ensure_quadratic_bezier(ArrowStyle._Base.ensure_quadratic_bezier  s|     D..01HH"hqk!n&CQKNdkk1 BD D5Xa[^5hqk!n55rN   c                     [        S5      e)a%  
The transmute method is the very core of the ArrowStyle class and
must be overridden in the subclasses. It receives the *path*
object along which the arrow will be drawn, and the
*mutation_size*, with which the arrow head etc. will be scaled.
The *linewidth* may be used to adjust the path so that it does not
pass beyond the given points. It returns a tuple of a `.Path`
instance and a boolean. The boolean value indicate whether the
path can be filled or not. The return value can also be a list of
paths and list of booleans of the same length.
r"  r#  )rI   rT   r  r%   s       rL   	transmuteArrowStyle._Base.transmute  s     &&=>>rN   c                 X   Ub  UR                   SU/-  n[        XQR                  5      nU R                  UUU5      u  px[        R
                  " U5      (       a8  U V	s/ s H(  n	[        U	R                   SU/-  U	R                  5      PM*     n
n	X4$ Xx4$ U R                  XU5      $ s  sn	f )zg
The __call__ method is a thin wrapper around the transmute method
and takes care of the aspect ratio.
r   )ro   r   rn   r  rp   iterable)rI   rT   r  r%   aspect_ratioro   path_shrunkpath_mutatedfillabler  	path_lists              rL   r  ArrowStyle._Base.__call__  s     '==A|+<<"8ZZ8)-8E8A*C& ;;x(( +7!8*6Q "&ajjA|3D&Dagg!N*6  !8$..'11~~d9EE!8s   /B'rm  N)rl  )
r/  r0  r1  r2  r3  staticmethodr  r  r  r8  rm  rN   rL   r  r    s+    		 
	6 
	6	? #%	FrN   r  c                   T   ^  \ rS rSrSrSrS=rr   S
U 4S jjrS r	S r
S rS	rU =r$ )ArrowStyle._Curvei  a	  
A simple arrow which will work with any path instance. The
returned path is the concatenation of the original path, and at
most two paths representing the arrow head or bracket at the start
point and at the end point. The arrow heads can be either open
or closed.
-Fc                 l  > XsU l         U l        X4sU l        U l        XVsU l        U l        XxsU l        U l        XsU l        U l	        SU l
        SU l        SU l        SU l        SU R                  ;  a  [        S5      eU R                  R!                  SS5      u  pUS:X  a  SU l
        SU l        O0US:X  a  SU l
        SU l        SU l        OUS;   a  SU l
        SU l        US	:X  a  SU l        SU l        O0US
:X  a  SU l        SU l        SU l        OUS;   a  SU l        SU l        [&        TU ]Q  5         g)a/  
Parameters
----------
head_length : float, default: 0.4
    Length of the arrow head, relative to *mutation_size*.
head_width : float, default: 0.2
    Width of the arrow head, relative to *mutation_size*.
widthA, widthB : float, default: 1.0
    Width of the bracket.
lengthA, lengthB : float, default: 0.2
    Length of the bracket.
angleA, angleB : float, default: 0
    Orientation of the bracket, as a counterclockwise angle.
    0 degrees means perpendicular to the line.
scaleA, scaleB : float, default: *mutation_size*
    The scale of the brackets.
Fr  z-arrow must have the '-' between the two headsr   <Tz<|)rs  rr  >z|>)[rr  N)r  r  widthAwidthBlengthAlengthBrS  rT  scaleAscaleB_beginarrow_head_beginarrow_bracket_endarrow_head_endarrow_bracketarrowrG  rt   	fillbeginfillendr/   r0   )rI   r  r  r  r  r  r  rS  rT  r  r  
beginarrowendarrowrK   s                rL   r0   ArrowStyle._Curve.__init__  sM   * 1<-Ddo'-$DK)0&DL$,'-$DK'-$DK$)D!',D$"'D%*D"$**$  "1 2 2 $(::#3#3C#; JS (,%+0(t#(,%+0(!%z)(-%+/(3&*#).&T!&*#).&#Z'&+#)-&GrN   c	                    X-
  X$-
  p[         R                  " X5      nSU-  U-  nUS:X  a  SnX-  U-  nX-  U-  nX-  U-  n	X-  U-  n
Xi-  Xz-  -   U* U	-  Xj-  -   nnXi-  Xz-  -
  Xy-  Xj-  -   nnX=-   U-   XN-   U-   4X=-   XN-   4X=-   U-   XN-   U-   4/n[        R                  [        R                  [        R                  /nUUX4$ )z
Return the paths for arrow heads. Since arrow lines are
drawn with capstyle=projected, The arrow goes beyond the
desired point. This method also returns the amount of the path
to be shrunken so that it does not overshoot.
rC  r   r   )rp   rz  r   rr   r  )rI   rw  rx  ry  rz  	head_distcos_tsin_tr%   rn  ro  cp_distancepad_projectedr  r  rf  rg  rj  rk  vertices_arrowcodes_arrows                        rL   _get_arrow_wedge"ArrowStyle._Curve._get_arrow_wedge"  s    Wbg((2*K  )^e3M a  ${2C${2C !I-B!I-BzEJ.ej0HCzEJ.
UZ0GC!x#~rx#~>!x2!x#~rx#~>@N  ;;;;;;(K ";88rN   c                 x   [        X4X5      u  pSSKJn
  U
" XXU5      u  p4pXh-  Xi-  pX=-   XN-   4X44X4X-   X-   4/n[        R                  [        R
                  [        R
                  [        R
                  /nU(       a6  [        R                  " 5       R                  XU5      nUR                  U5      nUU4$ )Nr   )get_normal_points)
r   matplotlib.bezierr  r   rr   r  r   r   rotate_deg_aroundr  )rI   rw  rx  ry  rz  rp  r  rd  r  r  r  rF  rG  rn  ro  r  r  rS   s                     rL   _get_bracketArrowStyle._Curve._get_bracketL  s     'rr6LE <.ruUKNBB^V^!w0!h!h!w02N  ;;;;;;;;(K
 "++-??N!&!@!;..rN   c           
         U R                   (       d  U R                  (       a;  U R                  U-  nU R                  U-  n[        R
                  " XE5      nXF-  XV-  pU R                  c  UOU R                  n	U R                  c  UOU R                  n
UR                  S   u  pUR                  S   u  pU R                   =(       a    X4X4:g  nU(       a  U R                  XXWWWU5      O/ / SS4u  nnnnUR                  S   u  nnUR                  S   u  nnU R                  =(       a	    UU4UU4:g  nU(       a  U R                  UUUUWWWU5      O/ / SS4u  nnnn[        [        R                  " UU-   UU-   4/UR                  SS UU-   UU-   4//5      UR                  5      /nS/nU(       a  U R                  (       aC  UR                  [        / UQSP/ UQ[        R                  P5      5        UR                  S5        OUR                  [        UU5      5        UR                  S5        OU R                   (       a  UR                  S   u  pUR                  S   u  pU R#                  XXU R$                  U	-  U R&                  U	-  U R(                  5      u  nnUR                  [        UU5      5        UR                  S5        U(       a  U R*                  (       aF  UR                  S5        UR                  [        / UQSP/ UQ[        R                  P5      5        UU4$ UR                  S5        UR                  [        UU5      5         UU4$ U R,                  (       a  UR                  S   u  pUR                  S   u  pU R#                  XXU R.                  U
-  U R0                  U
-  U R2                  5      u  nnUR                  [        UU5      5        UR                  S5        UU4$ )Nr   r   r  r  Fr  T)r  r  r  r  rp   rz  r  r  ro   r  r   r  rn   r  r  rJ  r  r  r  r  rS  r  r  r  r  rT  )rI   rT   r  r%   r  r  r  r  r  r  r  rw  rx  ry  rz  has_begin_arrow	verticesAcodesAddxAddyArF  rG  x3y3has_end_arrow	verticesBcodesBddxBddyBpathsfillss                                  rL   r  ArrowStyle._Curve.transmutef  s   $$(;(;"..>!__}<
HH[=	*6
8Nu&*kk&9]t{{F&*kk&9]t{{F ]]1%FB]]1%FB #33LRH8LO # %%bb&/yJ "a^	 *IvtT ]]2&FB]]2&FB !//HRHR4HM ! %%b"b"&/yJ "a^	 *IvtT "..BIrDy+A*B*.--"*=,.IrDy+A*B*D E **& 'E GE>>LL1y1&13LV3LT^^3LMOLL&LLi!89LL'))q)q)$($5$5bb6:kkF6J6:llV6K6:kk%C!	6
 T)V45U#<<LL&LL1y1&13LV3LT^^3LMO  %< LL'LLi!89 %< ''r*r*$($5$5bb6:kkF6J6:llV6K6:kk%C!	6
 T)V45U#%<rN   )r  r  r  r  rS  rT  r  r  r  r  r  r  r  r  r  r  )
皙?皙?rl  rl  r  r  r   r   NN)r/  r0  r1  r2  r3  r  r  r  r0   r  r  r  r8  r9  r:  s   @rL   _Curver    s?    	 ##	GLNJN <	|(	9T	/4S	  S	 rN   r  r  r  c                   ,   ^  \ rS rSrSrU 4S jrSrU =r$ )ArrowStyle.Curvei  z&A simple curve without any arrow head.c                 "   > [         TU ]  SSS9  g )Nr  rj  )r  r  r  )rI   rK   s    rL   r0   ArrowStyle.Curve.__init__  s     G;rN   rm  )r/  r0  r1  r2  r3  r0   r8  r9  r:  s   @rL   Curver    s    4	< 	<rN   r  <-c                       \ rS rSrSrSrSrg)ArrowStyle.CurveAi  z(An arrow with a head at its start point.r  rm  Nr/  r0  r1  r2  r3  r  r8  rm  rN   rL   CurveAr    s
    6rN   r  ->c                       \ rS rSrSrSrSrg)ArrowStyle.CurveBi  z&An arrow with a head at its end point.r  rm  Nr  rm  rN   rL   CurveBr    s
    4rN   r  <->c                       \ rS rSrSrSrSrg)ArrowStyle.CurveABi  z8An arrow with heads both at the start and the end point.r  rm  Nr  rm  rN   rL   CurveABr    s
    FrN   r  <|-c                       \ rS rSrSrSrSrg)ArrowStyle.CurveFilledAi  z0An arrow with filled triangle head at the start.r  rm  Nr  rm  rN   rL   CurveFilledAr    s
    >rN   r  -|>c                       \ rS rSrSrSrSrg)ArrowStyle.CurveFilledBi  z.An arrow with filled triangle head at the end.r   rm  Nr  rm  rN   rL   CurveFilledBr    s
    <rN   r  <|-|>c                       \ rS rSrSrSrSrg)ArrowStyle.CurveFilledABi  z1An arrow with filled triangle heads at both ends.r  rm  Nr  rm  rN   rL   CurveFilledABr    s
    ?rN   r  ]-c                   4   ^  \ rS rSrSrSrSU 4S jjrSrU =r$ )ArrowStyle.BracketAi  z5An arrow with an outward square bracket at its start.r  c                 "   > [         TU ]  XUS9  ga  
Parameters
----------
widthA : float, default: 1.0
    Width of the bracket.
lengthA : float, default: 0.2
    Length of the bracket.
angleA : float, default: 0 degrees
    Orientation of the bracket, as a counterclockwise angle.
    0 degrees means perpendicular to the line.
)r  r  rS  Nr  rI   r  r  rS  rK   s       rL   r0   ArrowStyle.BracketA.__init__       GFFKrN   rm  rl  r  r   	r/  r0  r1  r2  r3  r  r0   r8  r9  r:  s   @rL   BracketAr
    s    C	L 	LrN   r  -[c                   4   ^  \ rS rSrSrSrSU 4S jjrSrU =r$ )ArrowStyle.BracketBi  z3An arrow with an outward square bracket at its end.r  c                 "   > [         TU ]  XUS9  ga  
Parameters
----------
widthB : float, default: 1.0
    Width of the bracket.
lengthB : float, default: 0.2
    Length of the bracket.
angleB : float, default: 0 degrees
    Orientation of the bracket, as a counterclockwise angle.
    0 degrees means perpendicular to the line.
)r  r  rT  Nr  rI   r  r  rT  rK   s       rL   r0   ArrowStyle.BracketB.__init__  r  rN   rm  r  r  r:  s   @rL   BracketBr    s    A	L 	LrN   r  ]-[c                   8   ^  \ rS rSrSrSr  SU 4S jjrSrU =r$ )ArrowStyle.BracketABi  z3An arrow with outward square brackets at both ends.r  c           	      &   > [         TU ]  XUXEUS9  g)a/  
Parameters
----------
widthA, widthB : float, default: 1.0
    Width of the bracket.
lengthA, lengthB : float, default: 0.2
    Length of the bracket.
angleA, angleB : float, default: 0 degrees
    Orientation of the bracket, as a counterclockwise angle.
    0 degrees means perpendicular to the line.
r  r  rS  r  r  rT  Nr  )rI   r  r  rS  r  r  rT  rK   s          rL   r0   ArrowStyle.BracketAB.__init__  s!     GFF$*F  LrN   rm  )rl  r  r   rl  r  r   r  r:  s   @rL   	BracketABr    s    A 5645	L 	LrN   r!  |-|c                   4   ^  \ rS rSrSrSrSU 4S jjrSrU =r$ )ArrowStyle.BarABi  z/An arrow with vertical bars ``|`` at both ends.r"  c           	      *   > [         TU ]  USUUSUS9  g)z
Parameters
----------
widthA, widthB : float, default: 1.0
    Width of the bracket.
angleA, angleB : float, default: 0 degrees
    Orientation of the bracket, as a counterclockwise angle.
    0 degrees means perpendicular to the line.
r   r  Nr  )rI   r  rS  r  rT  rK   s        rL   r0   ArrowStyle.BarAB.__init__#  s%     GFAf$*Af  FrN   rm  )rl  r   rl  r   r  r:  s   @rL   BarABr$    s    =	F 	FrN   r'  ]->c                   4   ^  \ rS rSrSrSrSU 4S jjrSrU =r$ )ArrowStyle.BracketCurvei0  zM
An arrow with an outward square bracket at its start and a head at
the end.
r(  c                 "   > [         TU ]  XUS9  gr  r  r  s       rL   r0    ArrowStyle.BracketCurve.__init__8  r  rN   rm  rl  r  Nr  r:  s   @rL   BracketCurver*  0      	 	L 	LrN   r.  <-[c                   4   ^  \ rS rSrSrSrSU 4S jjrSrU =r$ )ArrowStyle.CurveBracketiF  zM
An arrow with an outward square bracket at its end and a head at
the start.
r0  c                 "   > [         TU ]  XUS9  gr  r  r  s       rL   r0    ArrowStyle.CurveBracket.__init__N  r  rN   rm  r-  r  r:  s   @rL   CurveBracketr2  F  r/  rN   r5  c                   6   ^  \ rS rSrSrSU 4S jjrS rSrU =r$ )ArrowStyle.Simplei\  u:   A simple arrow. Only works with a quadratic Bézier curve.c                 L   > XUsU l         U l        U l        [        TU ]  5         g)z
Parameters
----------
head_length : float, default: 0.5
    Length of the arrow head.

head_width : float, default: 0.5
    Width of the arrow head.

tail_width : float, default: 0.2
    Width of the arrow tail.
Nr  r  
tail_widthr/   r0   rI   r  r  r:  rK   s       rL   r0   ArrowStyle.Simple.__init__`  '      ?DdotGrN   c                    U R                  U5      u  pEpgpU R                  U-  n
[        XU
5      nXE4Xg4X4/n [        X5      u  pU R                  U-  n[        UUS-  SS9u  nnUGb(  U R                  U-  n[        UUS-  5      u  nn[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4/nOz[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4/n[        U VVs/ s H  u  nnUPM
     snnU VVs/ s H  u  nnUPM
     snn5      nUS4$ ! [         a,    [        XXgU
5      u  pESXH-   -  SXY-   -  nnXE4UU4X4/nS n GN7f = fs  snnf s  snnf )NrC  r~  wmr   r   r  T)r  r  r   r   r   r  r  r   r:  r   r   rr   r   r  rJ  )rI   rT   r  r%   rw  rx  ry  rz  rF  rG  r  in_f
arrow_path	arrow_outarrow_inx1ny1nr  	head_left
head_rightr:  	tail_left
tail_right
patch_pathr   r  s                             rL   r  ArrowStyle.Simple.transmuteq  s   %)%A%A$%G"BBB **]:K 5D(RHrh7J	!=jO $	 =8J$78BRB%P!Iz $!__}<
(5i6@2o)G%	:  ${{JqM:#{{JqM:#{{JqM:#{{JqM:#{{JqM:#{{JqM:#{{IaL9#{{IaL9#{{IaL9#{{IaL9#{{IaL9#{{JqM:#~~z!}= 
  ${{JqM:#{{JqM:#{{JqM:#{{IaL9#{{IaL9#~~y|< 
 z2ztq!z2:4N:41aQ:4NOD:Y 0 ! -RR[I"'?C27OSHsCj2(; 	!T 34Ns   I	 J
.J	2I?>I?r  r  r:  )rC  rC  r  	r/  r0  r1  r2  r3  r0   r  r8  r9  r:  s   @rL   Simpler7  \  s    H	"8	 8	rN   rO  c                   6   ^  \ rS rSrSrSU 4S jjrS rSrU =r$ )ArrowStyle.Fancyi  u9   A fancy arrow. Only works with a quadratic Bézier curve.c                 L   > XUsU l         U l        U l        [        TU ]  5         g)z
Parameters
----------
head_length : float, default: 0.4
    Length of the arrow head.

head_width : float, default: 0.4
    Width of the arrow head.

tail_width : float, default: 0.4
    Width of the arrow tail.
Nr9  r;  s       rL   r0   ArrowStyle.Fancy.__init__  r=  rN   c                    U R                  U5      u  pEpgpU R                  U-  n
XE4Xg4X4/n[        XU
5      n [        X5      u  pUn[        XU
S-  5      n[        X5      u  pUnU R                  U-  n[        UUS-  SS9u  nnU R                  U-  n[        UUS-  SSSS9u  nn[        XEUS-  5      n[        X5      u  pUS	   nUUnn[        R                  U4[        R                  US
   4[        R                  US   4[        R                  US   4[        R                  US
   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US
   4[        R                  US   4[        R                  US   4[        R                  US
   4[        R                  U4[        R                  U4/n[        U VVs/ s H  u  nnUPM
     snnU VVs/ s H  u  nnUPM
     snn5      nUS4$ ! [         a,    [        XXgU
5      u  pESXH-   -  SXY-   -  nnXE4UU4X4/nUn GNf = fs  snnf s  snnf )NrC  rk  r~  g333333?r?  rl  rl  )w1r@  w2r  r   r   r  T)r  r  r   r   r   r  r  r   r:  r   rr   r  r   rJ  )rI   rT   r  r%   rw  rx  ry  rz  rF  rG  r  rB  rA  path_outpath_in	path_headrE  rF  	path_tailr  head_lhead_rr:  rI  rJ  
tail_startrH  rG  rK  r   r  s                                  rL   r  ArrowStyle.Fancy.transmute  s   %)%A%A$%G"BBB **]:K(RHrh7J !5D$$M%&! $	 !r)9:D I!"H I =8J01;b468NFF
 =8J$7	8BR;=##%O!Iz
 !b9D I!"G J$*F	J;;
3;;
16;;
16;;
16;;
16;;
16;;
16;;	!5;;	!5;;	!5;;	!5;;	!5;;
3>>:6J z2ztq!z2:4N:41aQ:4NOD:i 0 ' -RR[I"'?C27OS!hc
RH=
&	'd 34Ns   H )I
 I2IIrM  )r  r  r  rN  r:  s   @rL   FancyrQ    s    G	"A	 A	rN   r_  c                   6   ^  \ rS rSrSrSU 4S jjrS rSrU =r$ )ArrowStyle.Wedgei  u   
Wedge(?) shape. Only works with a quadratic Bézier curve.  The
start point has a width of the *tail_width* and the end point has a
width of 0. At the middle, the width is *shrink_factor*x*tail_width*.
c                 :   > Xl         X l        [        TU ]  5         g)z
Parameters
----------
tail_width : float, default: 0.3
    Width of the tail.

shrink_factor : float, default: 0.5
    Fraction of the arrow width at the middle point.
N)r:  shrink_factorr/   r0   )rI   r:  rc  rK   s      rL   r0   ArrowStyle.Wedge.__init__  s     )O!.GrN   c           	      2   U R                  U5      u  pEpgpXE4Xg4X4/n
[        U
U R                  U-  S-  U R                  S9u  p[        R
                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4[        R                  US   4/n[	        U VVs/ s H  u  pUPM	     snnU VVs/ s H  u  pUPM	     snn5      nUS4$ s  snnf s  snnf )Nr~  r?  r   r   r  T)	r  r   r:  rc  r   rr   r   r  rJ  )rI   rT   r  r%   rw  rx  ry  rz  rF  rG  rB  b_plusb_minusrK  r   r  s                   rL   r  ArrowStyle.Wedge.transmute  s   %)%A%A$%G"BBB(RHrh7J1$.$(OOm$Cb$H'+'9'9;OF
  ;;q	2;;q	2;;q	2;;
3;;
3;;
3>>71:6J z2ztqz2:4N:41Q:4NOD: 34Ns   D
3D)rc  r:  )rl  rC  rN  r:  s   @rL   r<  ra    s    			 	rN   r<  rm  N)r/  r0  r1  r2  r3  rx  r  r  r  r  r  r  r  r  r  r  r  r  r!  r'  r.  r5  rO  r_  r<  r8  rm  rN   rL   r  r  _  sa   ,\ KEF EFNa  a F [s+< < ,< [t,  - [t,  - [u-&  . [u-v  . [u-v  . [w/  0 [t,L6 L -L$ [t,L6 L -L$ [u-LF L .L* [u-F F .F" [u-Lv L .L* [u-Lv L .L* [!L L "L\ [!U U "Un [!) ) ")rN   r  c                      ^  \ rS rSrSrSrS r\R                  SSSS.U 4S jjj5       r	\R                  SS j5       r
S	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS rS rS rSrU =r$ )FancyBboxPatchi0  a7  
A fancy box around a rectangle with lower left at *xy* = (*x*, *y*)
with specified width and height.

`.FancyBboxPatch` is similar to `.Rectangle`, but it draws a fancy box
around the rectangle. The transformation of the rectangle box to the
fancy box is delegated to the style classes defined in `.BoxStyle`.
Tc                     U R                   R                  S-   nXR                  U R                  U R                  U R
                  4-  $ )Nz((%g, %g), width=%g, height=%g))rK   r/  rv  rw  rb  rc  r  s     rL   r?  FancyBboxPatch.__str__<  s9    NN##&GGGGTWWdkk4<<@@@rN   r   )mutation_scalemutation_aspectc                   > [         TU ]  " S0 UD6  Uu  U l        U l        X l        X0l        U R                  U5        XPl        X`l        SU l	        g)a.  
Parameters
----------
xy : (float, float)
  The lower left corner of the box.

width : float
    The width of the box.

height : float
    The height of the box.

boxstyle : str or `~matplotlib.patches.BoxStyle`
    The style of the fancy box. This can either be a `.BoxStyle`
    instance or a string of the style name and optionally comma
    separated attributes (e.g. "Round, pad=0.2"). This string is
    passed to `.BoxStyle` to construct a `.BoxStyle` object. See
    there for a full documentation.

    The following box styles are available:

    %(BoxStyle:table)s

mutation_scale : float, default: 1
    Scaling factor applied to the attributes of the box style
    (e.g. pad or rounding_size).

mutation_aspect : float, default: 1
    The height of the rectangle will be squeezed by this value before
    the mutation and the mutated box will be stretched by the inverse
    of it. For example, this allows different horizontal and vertical
    padding.

Other Parameters
----------------
**kwargs : `~matplotlib.patches.Patch` properties

%(Patch:kwdoc)s
TNrm  )
r/   r0   rv  rw  rb  rc  set_boxstyle_mutation_scale_mutation_aspectr   )	rI   r,  rp  rq  boxstylerm  rn  rJ   rK   s	           rL   r0   FancyBboxPatch.__init__@  sO    V 	"6"(#- /
rN   c                     Uc  [         R                  5       $ [        U[        5      (       a  [        U40 UD6OUU l        SU l        g)a?  
Set the box style, possibly with further attributes.

Attributes from the previous box style are not reused.

Without argument (or with ``boxstyle=None``), the available box styles
are returned as a human-readable string.

Parameters
----------
boxstyle : str or `~matplotlib.patches.BoxStyle`
    The style of the box: either a `.BoxStyle` instance, or a string,
    which is the style name and optionally comma separated attributes
    (e.g. "Round,pad=0.2"). Such a string is used to construct a
    `.BoxStyle` object, as documented in that class.

    The following box styles are available:

    %(BoxStyle:table_and_accepts)s

**kwargs
    Additional attributes for the box style. See the table above for
    supported parameters.

Examples
--------
::

    set_boxstyle("Round,pad=0.2")
    set_boxstyle("round", pad=0.2)
NT)r  ru  rZ   r  _bbox_transmuterr   )rI   rs  rJ   s      rL   rp  FancyBboxPatch.set_boxstylet  sL    B ))++ (C(( X((.6 	 
rN   c                     U R                   $ )zReturn the boxstyle object.)rv  r   s    rL   get_boxstyleFancyBboxPatch.get_boxstyle  r   rN   c                     Xl         SU l        gz>
Set the mutation scale.

Parameters
----------
scale : float
TNrq  r   rI   r  s     rL   set_mutation_scale!FancyBboxPatch.set_mutation_scale        %
rN   c                     U R                   $ )zReturn the mutation scale.rq  r   s    rL   get_mutation_scale!FancyBboxPatch.get_mutation_scale  s    ###rN   c                     Xl         SU l        gzR
Set the aspect ratio of the bbox mutation.

Parameters
----------
aspect : float
TNrr  r   rI   aspects     rL   set_mutation_aspect"FancyBboxPatch.set_mutation_aspect       !'
rN   c                 8    U R                   b  U R                   $ S$ z-Return the aspect ratio of the bbox mutation.r   rr  r   s    rL   get_mutation_aspect"FancyBboxPatch.get_mutation_aspect  #    )-)>)>)J%% 		rN   c                    U R                  5       nU R                  5       nU" U R                  U R                  U-  U R                  U R
                  U-  U R                  5       5      n[        UR                  SU/-  UR                  5      $ )z)Return the mutated path of the rectangle.r   )
ry  r  rv  rw  rb  rc  r  r   ro   rn   )rI   rs  m_aspectrT   s       rL   rQ   FancyBboxPatch.get_path  sw    $$&++-8!3T\\H%<//13 DMMQM14::>>rN   c                     U R                   $ )z'Return the left coord of the rectangle.)rv  r   s    rL   r  FancyBboxPatch.get_x      wwrN   c                     U R                   $ )z)Return the bottom coord of the rectangle.)rw  r   s    rL   r  FancyBboxPatch.get_y  r  rN   c                     U R                   $ r  r  r   s    rL   r  FancyBboxPatch.get_width  r   rN   c                     U R                   $ r  r  r   s    rL   r  FancyBboxPatch.get_height  r  rN   c                     Xl         SU l        g)zG
Set the left coord of the rectangle.

Parameters
----------
x : float
TN)rv  r   r  s     rL   r  FancyBboxPatch.set_x       
rN   c                     Xl         SU l        g)zI
Set the bottom coord of the rectangle.

Parameters
----------
y : float
TN)rw  r   r  s     rL   r  FancyBboxPatch.set_y  r  rN   c                     Xl         SU l        g)z;
Set the rectangle width.

Parameters
----------
w : float
TNr  r   s     rL   r  FancyBboxPatch.set_width  s     
rN   c                     Xl         SU l        g)z<
Set the rectangle height.

Parameters
----------
h : float
TNr  r  s     rL   r  FancyBboxPatch.set_height  s     
rN   c                 |    [        U5      S:X  a	  US   u  p#pEOUu  p#pEX l        X0l        X@l        XPl        SU l        g)a9  
Set the bounds of the rectangle.

Call signatures::

    set_bounds(left, bottom, width, height)
    set_bounds((left, bottom, width, height))

Parameters
----------
left, bottom : float
    The coordinates of the bottom left corner of the rectangle.
width, height : float
    The width/height of the rectangle.
r   r   TN)rG   rv  rw  rb  rc  r   r  s         rL   r  FancyBboxPatch.set_bounds  sB      t9>aJA!QJA!
rN   c                     [         R                  R                  U R                  U R                  U R
                  U R                  5      $ r  )r   r  from_boundsrv  rw  rb  rc  r   s    rL   r  FancyBboxPatch.get_bbox!  s4    **477DGG+/;;F 	FrN   )rv  rc  rr  rq  rb  rv  rw  r   )r  rd   )r/  r0  r1  r2  r3  r   r?  r   r6  r0   rp  ry  r  r  r  r  rQ   r  r  r  r  r  r  r  r  r  r  r8  r9  r:  s   @rL   rj  rj  0  s     MA 1 !11 1 1f % %N%	$	
?				4F FrN   rj  c                     ^  \ rS rSrSrSrS r\R                  SSSSSSSSS	S	S
.	U 4S jjj5       r	S r
S rS r\R                  SS j5       rS r\R                  SS j5       rS rS rS rS rS rS rS rS rSrU =r$ )FancyArrowPatchi'  a  
A fancy arrow patch.

It draws an arrow using the `ArrowStyle`. It is primarily used by the
`~.axes.Axes.annotate` method.  For most purposes, use the annotate method for
drawing arrows.

The head and tail positions are fixed at the specified start and end points
of the arrow, but the size and shape (in display coordinates) of the arrow
does not change when the axis is moved or zoomed.
Tc           
          U R                   b;  U R                   u  u  pu  p4[        U 5      R                   SUS SUS SUS SUS S3
$ [        U 5      R                   SU R                   S3$ )Nz((gz, z)->(z))(r>  )
_posA_posBtyper/  _path_original)rI   ry  rz  rF  rG  s        rL   r?  FancyArrowPatch.__str__5  s{    ??&!%HRhr4j))*"RF"RF$r!fBr!fBOO4j))*!D,?,?+@BBrN   Nsimplearc3r  r   )	rT   
arrowstyleconnectionstyler<  r=  r:  r;  rm  rn  c       	           > UR                  S[        R                  5        UR                  S[        R                  5        [        TU ]  " S0 UD6  Ub%  Ub"  Uc  X/U l        Uc  SnU R                  U5        OUc  Uc  Ub  SU l        O[        S5      eX`l	        Xpl
        Xl        Xl        X0l        U R                  U5        Xl        Xl        SU l        g)a&	  
There are two ways for defining an arrow:

- If *posA* and *posB* are given, a path connecting two points is
  created according to *connectionstyle*. The path will be
  clipped with *patchA* and *patchB* and further shrunken by
  *shrinkA* and *shrinkB*. An arrow is drawn along this
  resulting path using the *arrowstyle* parameter.

- Alternatively if *path* is provided, an arrow is drawn along this
  path and *patchA*, *patchB*, *shrinkA*, and *shrinkB* are ignored.

Parameters
----------
posA, posB : (float, float), default: None
    (x, y) coordinates of arrow tail and arrow head respectively.

path : `~matplotlib.path.Path`, default: None
    If provided, an arrow is drawn along this path and *patchA*,
    *patchB*, *shrinkA*, and *shrinkB* are ignored.

arrowstyle : str or `.ArrowStyle`, default: 'simple'
    The `.ArrowStyle` with which the fancy arrow is drawn.  If a
    string, it should be one of the available arrowstyle names, with
    optional comma-separated attributes.  The optional attributes are
    meant to be scaled with the *mutation_scale*.  The following arrow
    styles are available:

    %(ArrowStyle:table)s

connectionstyle : str or `.ConnectionStyle` or None, optional, default: 'arc3'
    The `.ConnectionStyle` with which *posA* and *posB* are connected.
    If a string, it should be one of the available connectionstyle
    names, with optional comma-separated attributes.  The following
    connection styles are available:

    %(ConnectionStyle:table)s

patchA, patchB : `~matplotlib.patches.Patch`, default: None
    Head and tail patches, respectively.

shrinkA, shrinkB : float, default: 2
    Shrink amount, in points, of the tail and head of the arrow respectively.

mutation_scale : float, default: 1
    Value with which attributes of *arrowstyle* (e.g., *head_length*)
    will be scaled.

mutation_aspect : None or float, default: None
    The height of the rectangle will be squeezed by this value before
    the mutation and the mutated box will be stretched by the inverse
    of it.

Other Parameters
----------------
**kwargs : `~matplotlib.patches.Patch` properties, optional
    Here is a list of available `.Patch` properties:

%(Patch:kwdoc)s

    In contrast to other patches, the default ``capstyle`` and
    ``joinstyle`` for `FancyArrowPatch` are set to ``"round"``.
r,   r+   Nr  z.Either posA and posB, or path need to providedrl  rm  )r   r   r  r   r/   r0   r  set_connectionstylerG  r<  r=  r:  r;  r  set_arrowstylerq  rr  _dpi_cor)rI   r8  r9  rT   r  r  r<  r=  r:  r;  rm  rn  rJ   rK   s                rL   r0   FancyArrowPatch.__init__<  s    L 	+y7*hnn5"6" 0T\#lDO&"($$_5\dlt/?"DOMNN"J'- /rN   c                 V    Ub  XR                   S'   Ub  X R                   S'   SU l        g)z
Set the start and end positions of the connecting path.

Parameters
----------
posA, posB : None, tuple
    (x, y) coordinates of arrow tail and arrow head respectively. If
    `None` use current value.
Nr   r   T)r  r   )rI   r8  r9  s      rL   set_positionsFancyArrowPatch.set_positions  s/     !%OOA!%OOA
rN   c                     Xl         SU l        g)zF
Set the tail patch.

Parameters
----------
patchA : `.patches.Patch`
TN)r<  r   )rI   r<  s     rL   
set_patchAFancyArrowPatch.set_patchA       
rN   c                     Xl         SU l        g)zF
Set the head patch.

Parameters
----------
patchB : `.patches.Patch`
TN)r=  r   )rI   r=  s     rL   
set_patchBFancyArrowPatch.set_patchB  r  rN   c                     Uc  [         R                  5       $ [        U[        5      (       a  [        U40 UD6OUU l        SU l        g)a  
Set the connection style, possibly with further attributes.

Attributes from the previous connection style are not reused.

Without argument (or with ``connectionstyle=None``), the available box
styles are returned as a human-readable string.

Parameters
----------
connectionstyle : str or `~matplotlib.patches.ConnectionStyle`
    The style of the connection: either a `.ConnectionStyle` instance,
    or a string, which is the style name and optionally comma separated
    attributes (e.g. "Arc,armA=30,rad=10"). Such a string is used to
    construct a `.ConnectionStyle` object, as documented in that class.

    The following connection styles are available:

    %(ConnectionStyle:table_and_accepts)s

**kwargs
    Additional attributes for the connection style. See the table above
    for supported parameters.

Examples
--------
::

    set_connectionstyle("Arc,armA=30,rad=10")
    set_connectionstyle("arc", armA=30, rad=10)
NT)r(  ru  rZ   r  
_connectorr   )rI   r  rJ   s      rL   r  #FancyArrowPatch.set_connectionstyle  sK    B ""0022 /3// O6v65D 	 
rN   c                     U R                   $ )z"Return the `ConnectionStyle` used.)r  r   s    rL   get_connectionstyle#FancyArrowPatch.get_connectionstyle  r   rN   c                     Uc  [         R                  5       $ [        U[        5      (       a  [        U40 UD6OUU l        SU l        g)aq  
Set the arrow style, possibly with further attributes.

Attributes from the previous arrow style are not reused.

Without argument (or with ``arrowstyle=None``), the available box
styles are returned as a human-readable string.

Parameters
----------
arrowstyle : str or `~matplotlib.patches.ArrowStyle`
    The style of the arrow: either a `.ArrowStyle` instance, or a
    string, which is the style name and optionally comma separated
    attributes (e.g. "Fancy,head_length=0.2"). Such a string is used to
    construct a `.ArrowStyle` object, as documented in that class.

    The following arrow styles are available:

    %(ArrowStyle:table_and_accepts)s

**kwargs
    Additional attributes for the arrow style. See the table above for
    supported parameters.

Examples
--------
::

    set_arrowstyle("Fancy,head_length=0.2")
    set_arrowstyle("fancy", head_length=0.2)
NT)r  ru  rZ   r  _arrow_transmuterr   )rI   r  rJ   s      rL   r  FancyArrowPatch.set_arrowstyle  sL    B ++-- *c** z,V,0: 	 
rN   c                     U R                   $ )zReturn the arrowstyle object.)r  r   s    rL   get_arrowstyleFancyArrowPatch.get_arrowstyle  s    %%%rN   c                     Xl         SU l        gr|  r}  r~  s     rL   r  "FancyArrowPatch.set_mutation_scale  r  rN   c                     U R                   $ )z4
Return the mutation scale.

Returns
-------
scalar
r  r   s    rL   r  "FancyArrowPatch.get_mutation_scale*  s     ###rN   c                     Xl         SU l        gr  r  r  s     rL   r  #FancyArrowPatch.set_mutation_aspect4  r  rN   c                 8    U R                   b  U R                   $ S$ r  r  r   s    rL   r  #FancyArrowPatch.get_mutation_aspect?  r  rN   c                     U R                  5       u  p[        R                  " U5      (       a  [        R                  " U6 nU R                  5       R                  5       R                  U5      $ )z5Return the path of the arrow in the data coordinates.)_get_path_in_displaycoordrp   r  r   make_compound_pathrP   invertedr  )rI   r  r  s      rL   rQ   FancyArrowPatch.get_pathD  sV     88:;;x  ++U3E!!#,,.==eDDrN   c           	      l   U R                   nU R                  b  U R                  U R                  S   5      nU R                  U R                  S   5      nU R                  5       R	                  X#45      u  p#U R                  5       " X#U R                  U R                  U R                  U-  U R                  U-  S9nO)U R                  5       R                  U R                  5      nU R                  5       " UU R                  5       U-  U R                  5       U-  U R                  5       5      u  pEXE4$ )<Return the mutated path of the arrow in display coordinates.r   r   r<  r=  r:  r;  )r  r  r-  rP   r  r  r<  r=  r:  r;  r  r  r  r  r]   r  )rI   dpi_corr8  r9  r  r  s         rL   r  )FancyArrowPatch._get_path_in_displaycoordM  s   --??&))$//!*<=D))$//!*<=D--/994,GLT,,.t6:kk6:kk7;||g7M7;||g7M	1E &&(778K8KLE--/##%/ 7*$$&	( rN   c                    U R                  5       (       d  g UR                  S5      U l        U R                  5       u  p#[        R
                  " U5      (       d  U/nU/n[        R                  " 5       nU R                  U[        X#5       VVs/ s H0  u  pVXTU(       a   U R                  S   (       a  U R                  OS 4PM2     snn5        g s  snnf )Nrl  rY   )r  rQ  r  r  rp   r  r   r   r  rF  r   )rI   r  rT   r  r  r  rJ  s          rL   r  FancyArrowPatch.drawf  s    !!
 !11"5779{{8$$6D zH--///T,., A$//!2D$O,.	/.s   7C)r  r  r  rr  rq  r  r  r<  r=  r:  r;  r   )NNrd   )r/  r0  r1  r2  r3  r   r?  r   r6  r0   r  r  r  r  r  r  r  r  r  r  r  rQ   r  r  r8  r9  r:  s   @rL   r  r  '  s    
 MC bxT1a !1b b bH 		 % %N % %N&	$	
E2/ /rN   r  c                      ^  \ rS rSrSrS r\R                  SSSSSSSSSSSS	S
.U 4S jjj5       rSS jr	S r
S rS rS rU 4S jrSrU =r$ )ConnectionPatchi|  z>A patch that connects two points (possibly in different Axes).c                 |    SU R                   S   U R                   S   U R                  S   U R                  S   4-  $ )Nz#ConnectionPatch((%g, %g), (%g, %g))r   r   )xy1xy2r   s    rL   r?  ConnectionPatch.__str__  s=    4TXXa[$((1+txx{CD 	DrN   Nr  r  ri  g      $@F)axesAaxesBr  r  r<  r=  r:  r;  rm  rn  rh  c                   > Uc  UnXl         X l        X0l        X@l        XPl        X`l        [        TU ]  " SSSUUXXUUUS.UD6  SU l        g)a  
Connect point *xyA* in *coordsA* with point *xyB* in *coordsB*.

Valid keys are

===============  ======================================================
Key              Description
===============  ======================================================
arrowstyle       the arrow style
connectionstyle  the connection style
relpos           default is (0.5, 0.5)
patchA           default is bounding box of the text
patchB           default is None
shrinkA          default is 2 points
shrinkB          default is 2 points
mutation_scale   default is text size (in points)
mutation_aspect  default is 1.
?                any key for `matplotlib.patches.PathPatch`
===============  ======================================================

*coordsA* and *coordsB* are strings that indicate the
coordinates of *xyA* and *xyB*.

==================== ==================================================
Property             Description
==================== ==================================================
'figure points'      points from the lower left corner of the figure
'figure pixels'      pixels from the lower left corner of the figure
'figure fraction'    0, 0 is lower left of figure and 1, 1 is upper
                     right
'subfigure points'   points from the lower left corner of the subfigure
'subfigure pixels'   pixels from the lower left corner of the subfigure
'subfigure fraction' fraction of the subfigure, 0, 0 is lower left.
'axes points'        points from lower left corner of the Axes
'axes pixels'        pixels from lower left corner of the Axes
'axes fraction'      0, 0 is lower left of Axes and 1, 1 is upper right
'data'               use the coordinate system of the object being
                     annotated (default)
'offset points'      offset (in points) from the *xy* value
'polar'              you can specify *theta*, *r* for the annotation,
                     even in cartesian plots.  Note that if you are
                     using a polar Axes, you do not need to specify
                     polar for the coordinate system since that is the
                     native "data" coordinate system.
==================== ==================================================

Alternatively they can be set to any valid
`~matplotlib.transforms.Transform`.

Note that 'subfigure pixels' and 'figure pixels' are the same
for the parent figure, so users who want code that is usable in
a subfigure can use 'subfigure pixels'.

.. note::

   Using `ConnectionPatch` across two `~.axes.Axes` instances
   is not directly compatible with :ref:`constrained layout
   <constrainedlayout_guide>`. Add the artist
   directly to the `.Figure` instead of adding it to a specific Axes,
   or exclude it from the layout using ``con.set_in_layout(False)``.

   .. code-block:: default

      fig, ax = plt.subplots(1, 2, constrained_layout=True)
      con = ConnectionPatch(..., axesA=ax[0], axesB=ax[1])
      fig.add_artist(con)

Nr  r  )r8  r9  r  r  r<  r=  r:  r;  rm  rn  rh  rm  )	r  r  coords1coords2r  r  r/   r0   _annotation_clip)rI   xyAxyBcoordsAcoordsBr  r  r  r  r<  r=  r:  r;  rm  rn  rh  rJ   rK   s                    rL   r0   ConnectionPatch.__init__  sm    b ?G

 	#f6$.)8 &!((6)8!(	# "	# !%rN   c                    UnUc  U R                   n[        R                  " US   5      n[        R                  " US   5      nU R                  SS9nUS;   a5  XWR                  -  S-  nXgR                  -  S-  nUR                  SS5      nO8US	:X  a  UR                  nO%US
:X  a  UR                  nOUS:X  a  UR                  nUS:X  a|  UR                  n[        R                  " UR                  R                  U5      5      n[        R                  " UR                  R                  U5      5      nUR                  XV45      $ US:X  aq  U R                   S:X  a  U R#                  U R$                  S5      $ U R#                  U R$                  U R                   5      XR                  SS9R                  -  S-  -   $ US:X  aR  XVpU
[        R&                  " U	5      -  nU
[        R(                  " U	5      -  nUR                  nUR                  XV45      $ US:X  ad  U R                  SS9R*                  nUS:  a  UR,                  U-   OUR.                  U-   nUS:  a  UR0                  U-   OUR2                  U-   nXV4$ US:X  ad  U R                  SS9R4                  nUS:  a  UR,                  U-   OUR.                  U-   nUS:  a  UR0                  U-   OUR2                  U-   nXV4$ US:X  aW  UR4                  nUS:  a  UR,                  U-   OUR.                  U-   nUS:  a  UR0                  U-   OUR2                  U-   nXV4$ [7        U[8        R:                  5      (       a  UR                  U5      $ [=        U S35      e)z,Calculate the pixel position of given point.r   r   Fr?  )zfigure pointszaxes pointsH   r   pixelszfigure fractionzsubfigure fractionzaxes fractiondatazoffset pointsTpolarzfigure pixelszsubfigure pixelszaxes pixelsz) is not a valid coordinate transformation)rB  rp   r  rC  dpir  transFiguretransSubfigure	transAxes	transDatar   _to_unmasked_float_arrayxaxisconvert_unitsyaxisr  xycoords_get_xyr,  rJ  rK  figbboxrw  ry  rx  rz  r  rZ   r   	TransformrG  )rI   r,  r   rB  s0rf   rg   figrS   rU  r>  bbs               rL   r
  ConnectionPatch._get_xy  s   <99D HHRUOHHRUOoo5o)00GGb AGGb A		(H-A##A&&""A/!A;NNE..tzz/G/G/JKA..tzz/G/G/JKA??A6**/!}}/||DGGV44TWWdmm4D1555:;< '\1BFF5M!ABFF5M!ANNE??A6**/!e,44B!V	A!V	A4K$$e,11B!V	A!V	A4K-B!V	A!V	A4K://00;;r?"t#LMNNrN   c                     Xl         SU l        g)aQ  
Set the annotation's clipping behavior.

Parameters
----------
b : bool or None
    - True: The annotation will be clipped when ``self.xy`` is
      outside the Axes.
    - False: The annotation will always be drawn.
    - None: The annotation will be clipped when ``self.xy`` is
      outside the Axes and ``self.xycoords == "data"``.
TN)r  r   r   s     rL   set_annotation_clip#ConnectionPatch.set_annotation_clip)  s     !"
rN   c                     U R                   $ )z`
Return the clipping behavior.

See `.set_annotation_clip` for the meaning of the return value.
)r  r   s    rL   get_annotation_clip#ConnectionPatch.get_annotation_clip9  s     $$$rN   c           	         U R                   nU R                  U R                  U R                  U R                  5      nU R                  U R
                  U R                  U R                  5      nU R                  5       " X#U R                  U R                  U R                  U-  U R                  U-  S9nU R                  5       " UU R                  5       U-  U R                  5       U-  U R!                  5       5      u  pEXE4$ )r  r  )r  r
  r  r  r  r  r  r  r  r<  r=  r:  r;  r  r  r]   r  )rI   r  r8  r9  rT   r  s         rL   r  )ConnectionPatch._get_path_in_displaycoordA  s    --||DHHdllDJJ?||DHHdllDJJ?'');;t{{LL7*DLL74J

 ,,.##%/ 7*$$&	
 ~rN   c                 D   U R                  5       nU(       d  Uc~  U R                  S:X  an  U R                  U R                  U R                  U R                  5      nU R                  c  U R
                  nOU R                  nUR                  U5      (       d  gU(       d  Uc~  U R                  S:X  an  U R                  U R                  U R                  U R                  5      nU R                  c  U R
                  nOU R                  nUR                  U5      (       d  gg)z/Check whether the annotation needs to be drawn.r  FT)
r  r  r
  r  r  rB  re   r  r  r  )rI   r  r   xy_pixelrB  s        rL   	_check_xyConnectionPatch._check_xyS  s     $$&t||v5||DHHdllDJJGHzz!yyzz&&x00t||v5||DHHdllDJJGHzz!yyzz&&x00rN   c                 |   > U R                  5       (       a  U R                  U5      (       d  g [        TU ]  U5        g rd   )r  r  r/   r  r[  s     rL   r  ConnectionPatch.drawl  s/    !!)A)AXrN   )r  r  r  r  r  r   r  r  rd   )r/  r0  r1  r2  r3  r?  r   r6  r0   r
  r  r  r  r  r  r8  r9  r:  s   @rL   r  r  |  sz    HD e%4!' #!%e% e% e%N<O| %$2 rN   r  rQ  )r  Nrd   )Mr3  r  r  r  numbersr   r   r  typesr   collectionsr   matplotlib.transformsr   numpyrp   
matplotlibr4   r   r	   r
   r   r   r   r   r   r   r   r   bezierr   r   r   r   r   r   r   r   rT   r   _enumsr   r   r6  define_aliasesr   r'   r<  r^  r  r  r  r"  r<  rg  r  rt  rv  getdocr0   
splitlinesr  r  r  r  r  rl  rn  rp  r  r  r(  r  r  rj  r  r  rm  rN   rL   <module>r*     s         ! " *  , , ,A A A  ' 6 r	FMM r	 r	j9U 9xV" V"r.!U .!b 8j	 jZ`Ee `EFSE SnPE Pff fR     yy	
++	,	2>>@DF  G
DN D2q'e q'hxe xv'.W '.Ts7' s7l.
S& S&l$  i-v i- i-X V)f V) V)r	 M M M`tFU tFnR/e R/j
so srN   