
    h7                         S r SSKrSSKJr  SSKrSSKrSSKJ	r	  SSK
Jr  SSKJr  SSKJr  \R                  " \5      rSrS	/rS
rSrSrSrSr " S S5      rg)z7
Module for creating Sankey diagrams using Matplotlib.
    N)SimpleNamespace)Path)	PathPatch)Affine2D)
_docstringzKevin L. DavieszYannick CopinBSDz
2011/09/16      c                       \ rS rSrSr   SS jrSS jrS rS r\	R                  4S jr\R                     SS	 j5       rS
 rSrg)Sankey   aF  
Sankey diagram.

  Sankey diagrams are a specific type of flow diagram, in which
  the width of the arrows is shown proportionally to the flow
  quantity.  They are typically used to visualize energy or
  material or cost transfers between processes.
  `Wikipedia (6/1/2011) <https://en.wikipedia.org/wiki/Sankey_diagram>`_

Nc                    US:  a  [        S5      eXe:  a  [        S5      eU	S:  a  [        S5      eUS:  a  [        S5      eUc)  SSKJn  UR                  5       nUR	                  SSS/ / S9n/ U l        Xl        X0l        X@l        X l	        XPl
        X`l        Xpl        Xl        Xl        [        R                   " [        R"                  SU	S	-  -
  -  S
-  5      U l        Xl        [        R(                  " [        R*                  [        R*                  * [        R*                  [        R*                  * 45      U l        [/        U5      (       a  U R0                  " S0 UD6  gg)a	  
Create a new Sankey instance.

The optional arguments listed below are applied to all subdiagrams so
that there is consistent alignment and formatting.

In order to draw a complex Sankey diagram, create an instance of
`Sankey` by calling it without any kwargs::

    sankey = Sankey()

Then add simple Sankey sub-diagrams::

    sankey.add() # 1
    sankey.add() # 2
    #...
    sankey.add() # n

Finally, create the full diagram::

    sankey.finish()

Or, instead, simply daisy-chain those calls::

    Sankey().add().add...  .add().finish()

Other Parameters
----------------
ax : `~matplotlib.axes.Axes`
    Axes onto which the data should be plotted.  If *ax* isn't
    provided, new Axes will be created.
scale : float
    Scaling factor for the flows.  *scale* sizes the width of the paths
    in order to maintain proper layout.  The same scale is applied to
    all subdiagrams.  The value should be chosen such that the product
    of the scale and the sum of the inputs is approximately 1.0 (and
    the product of the scale and the sum of the outputs is
    approximately -1.0).
unit : str
    The physical unit associated with the flow quantities.  If *unit*
    is None, then none of the quantities are labeled.
format : str or callable
    A Python number formatting string or callable used to label the
    flows with their quantities (i.e., a number times a unit, where the
    unit is given). If a format string is given, the label will be
    ``format % quantity``. If a callable is given, it will be called
    with ``quantity`` as an argument.
gap : float
    Space between paths that break in/break away to/from the top or
    bottom.
radius : float
    Inner radius of the vertical paths.
shoulder : float
    Size of the shoulders of output arrows.
offset : float
    Text offset (from the dip or tip of the arrow).
head_angle : float
    Angle, in degrees, of the arrow heads (and negative of the angle of
    the tails).
margin : float
    Minimum space between Sankey outlines and the edge of the plot
    area.
tolerance : float
    Acceptable maximum of the magnitude of the sum of flows.  The
    magnitude of the sum of connected flows cannot be greater than
    *tolerance*.
**kwargs
    Any additional keyword arguments will be passed to `add`, which
    will create the first subdiagram.

See Also
--------
Sankey.add
Sankey.finish

Examples
--------
.. plot:: gallery/specialty_plots/sankey_basics.py
r   zS'gap' is negative, which is not allowed because it would cause the paths to overlapz`'radius' is greater than 'gap', which is not allowed because it would cause the paths to overlapzp'head_angle' is negative, which is not allowed because it would cause inputs to look like outputs and vice versaz3'tolerance' is negative, but it must be a magnitudeNr	   )xticksyticksg     f@       @ )
ValueErrormatplotlib.pyplotpyplotfigureadd_subplotdiagramsaxunitformatscalegapradiusshoulderoffsetmarginnptanpipitch	tolerancearrayinfextentlenadd)selfr   r   r   r   r   r   r   r    
head_angler!   r&   kwargspltfigs                  C/var/www/html/env/lib/python3.13/site-packages/matplotlib/sankey.py__init__Sankey.__init__*   sN   f 7-. . <67 7 >IJ J q=EG G :+**,CAqB?B 	
 VVBEEQe);%;<sBC
" hh"&&AB v;;HHv     c                    [         R                  [         R                  [         R                  [         R                  [         R                  [         R                  [         R                  /n[        R                  " SS/SS/SS/SS/SS/SS/SS//5      nUS;   a  U(       a  UnOcUSS2SSS	24   nOVU(       a(  [        R
                  " USS2S
4   * USS2S4   45      nO'[        R
                  " USS2S4   * USS2S
4   45      nUS
:  a  U* n[        [        XSU-  [        R                  " XFR                  S   S
45      -   5      5      $ )a  
Return the codes and vertices for a rotated, scaled, and translated
90 degree arc.

Other Parameters
----------------
quadrant : {0, 1, 2, 3}, default: 0
    Uses 0-based indexing (0, 1, 2, or 3).
cw : bool, default: True
    If True, the arc vertices are produced clockwise; counter-clockwise
    otherwise.
radius : float, default: 1
    The radius of the arc.
center : (float, float), default: (0, 0)
    (x, y) tuple of the arc's center.
      ?g        gw,?gS?g?g>ef?)r      Nr	   r   )
r   LINETOCURVE4r"   r'   column_stacklistziptileshape)r,   quadrantcwr   center	ARC_CODESARC_VERTICESverticess           r1   _arcSankey._arc   sc   ( [[[[[[[[[[[[[["	 xx..!A"0.!A"0.!A"0.!A"0.!A"0.!A #1.!A!C D v''4R40 ??\!Q$-?,?-9!Q$-?,A B ??\!Q$-?,?-9!Q$-?,A Ba<WFC	H#4););A)>(BC$D E F 	Fr4   c                    Uc  SS/SS/4$ US   S   u  pVUS-  U R                   -  nU[        :X  a  XT-  nXW-   XcS-  -   /nUR                  [        R                  XV/4[        R                  U4[        R                  XVU-   /4[        R                  XPR
                  -   Xc-   /4/5        US   U R                  -
  US   /n	X4$ XPR
                  -  nU[        :X  a  Sn
OSn
XSS-  -
  XjXG-
  -  -
  /nU[        :X  a  SnOSnU R                  (       aP  UR                  U R                  UU[        :H  U R                  XPR                  -   XjU R                  -  -
  4S95        O"UR                  [        R                  XV/45        UR                  [        R                  XVX-  -
  /4[        R                  U4[        R                  XS-
  XjU-  -
  /4/5        UR                  U R                  UU[        :H  X0R                  -   XPR                  -   XjU R                  -  -
  4S95        UR                  [        R                  XS-
  XjU-  -   /45        US   US   XR                  -  -
  /n	X4$ )z@
Add an input to a path and return its tip and label locations.
r   r8   r	   r7   r   r@   rA   r   rB   )r%   RIGHTextendr   r9   r   r    UPDOWNr   rF   append)r,   pathangleflowlengthxydipdepthdiplabel_locationsignr@   s               r1   
_add_inputSankey._add_input   s    =q6Aq6>!8A;DAqDJJ.H~|Q^4dkkA62"kk3/"kkA4x=9"kkAL!(+CDF G #&a&4;;"6A!?D &&A XXB;DD!8|Q1B)C%CDD= H H ;;KK		8-2b[1523kk/23T[[6H2H2J !* !K L KKqf 56dkkA4=/@+AB"kk3/"kkAHa-6G+HIK L DIIx).$-1KK-?./++o./2D.D.F & G H
 T[[18Q_*EFG"%a&#a&4++3E*E!F&&r4   c                    Uc  SS/SS/4$ US   S   u  pVU R                   US-  -
  U R                  -  nU[        :X  a  XT-  nXW-   XcS-  -   /nUR                  [        R
                  XV/4[        R
                  XVU R                   -   /4[        R
                  U4[        R
                  XVU R                   -
  U-   /4[        R
                  XVU-   /4[        R
                  XPR                  -
  Xc-   /4/5        US   U R                  -   US   /n	X4$ XPR                  -  nU[        :X  a  Su  pOSu  pXSS-  -
  XjXG-   -  -   /nU R                  (       aP  UR                  U R                  UU[        :H  U R                  XPR                  -
  XjU R                  -  -   4S95        O"UR                  [        R
                  XV/45        UR                  [        R
                  XVX-  -   /4[        R
                  XPR                   -
  XjU-  -   /4[        R
                  U4[        R
                  XPR                   -   U-
  XjU-  -   /4[        R
                  XS-
  XjU-  -   /4/5        UR                  U R                  UU[        :H  U R                  U-
  XPR                  -
  XjU R                  -  -   4S95        UR                  [        R
                  XS-
  XjU-  -   /45        US   US   XR                  -  -   /n	X4$ )	zq
Append an output to a path and return its tip and label locations.

.. note:: *flow* is negative for an output.
r   r8   r	   r7   r   )r	   r
   )r8   r   rI   )r   r%   rJ   rK   r   r9   r   r    rL   r   rF   rN   rM   )r,   rO   rP   rQ   rR   rS   rT   	tipheighttiprW   rX   r@   s               r1   _add_outputSankey._add_output  s     =q6Aq6>!8A;DA1TZZ?I~}a*n5dkkA62"kkA4==/@+AB"kk3/"kkA4==/@4/G+HI"kkA4x=9"kkAL!(+CDF G #&a&4;;"6A!?@ &&= XXB;%)ND(%*ND#:~q63E+F'FG;;KK		8-2b[1523kk/23T[[6H2H2J !* !K L KKqf 56dkkA4=/@+AB"kkA,=,-v,=,? @"kk3/"kkA,=,D,-v,=,? @"kkAHa-6G+HIK L DIIx).$-1[[4-?./++o./2D.D.F & G H
 T[[18Q_*EFG"%a&#a&4++3E*E!F&&r4   c                 X    / nUnUSSS2    H  u  pVUR                  XF45        UnM     U$ )zw
A path is not simply reversible by path[::-1] since the code
specifies an action to take from the **previous** point.
Nr8   )rN   )r,   rO   first_actionreverse_path	next_codecodepositions          r1   _revertSankey._revertL  s@    
  	"4R4jND 56I ) r4   c
                 #   Uc  [         R                  " SS/5      O[         R                  " U5      nUR                  S   nU	c  Sn	OU	S-  n	Uc  Sn [         R                  " X;5      n [         R                  " XK5      nUS:  a  [	        S
5      e[        [         R                  " U5      5      U R                  :  a+  [        R                  S[         R                  " U5      U5        U R                  U-  n[        S U 5       5      n[        S U 5       5      nUGb  US:  a  [	        S5      e[        U5      S:  a  [	        S5      eU[        U R                  5      :  a%  [	        SU S[        U R                  5       S35      eUS   [        U R                  U   R                  5      :  a>  [	        SR                  US   [        U R                  U   R                  5      5      5      eUS   U:  a  [	        SUS    SU S35      eU R                  U   R                   US      c  [	        SUS    SU S35      eU R                  U   R                  US      X(S      -   n[        U5      U R                  :  a  [	        SU SU R                   S35      eS/U-  n[#        U5       HW  u  nnUU R                  :  a  SUU'   M  UU R                  * ::  a  SUU'   M5  [        R                  S UUU R                  5        MY     S/U-  n[#        [%        UU5      5       H  u  nu  nnUS:X  a$  U(       a  [&        UU'   M!  USL a  [(        UU'   M1  M3  US:X  a  Ub  [*        UU'   MG  MI  US!:w  a  [	        S"U S#U S$35      eU(       a  [(        UU'   Ms  USL d  Mz  [&        UU'   M     [         R,                  " U5      (       a,  [        U5      U:w  a  [	        S%U S&[        U5       S'35      eGOUnUnUnUn[/        US(9nU Vs/ s H  nUR1                  US5      PM     nn[#        [%        UUU5      5       HD  u  nu  nnnU[&        :X  a  U(       a  UUU'   UU-  nM'  U[(        :X  d  M3  USL d  M:  UUU'   UU-  nMF     [#        [3        [5        [%        UUU5      5      5      5       HN  u  nu  nnnU[(        :X  a  U(       a  UXkU-
  S-
  '   UU-  nM,  U[&        :X  d  M8  USL d  M?  UXkU-
  S-
  '   UU-  nMP     Sn[#        [3        [5        [%        UU[%        X5      5      5      5      5       H4  u  nu  nnnU[*        :X  d  M  U(       d  M  U(       a  SXkU-
  S-
  '   M2  SnM6     Sn[#        [%        UU[5        [%        X5      5      5      5       H-  u  nu  nnnU[*        :X  d  M  USL d  M  U(       a  SUU'   M+  SnM/     [6        R8                  U R:                  US)-  -
  US)-  /4[6        R<                  U R:                  US)-  -
  S)-  US)-  /4[6        R>                  U R:                  US)-  -
  S*-  US)-  /4[6        R>                  US)-  U R:                  -
  S*-  U* S)-  /4[6        R<                  US)-  U R:                  -
  S)-  U* S)-  /4[6        R<                  US)-  U R:                  -
  U* S)-  /4/n[6        R<                  US)-  U R:                  -
  US)-  /4[6        R<                  US)-  U R:                  -
  S)-  US)-  /4[6        R>                  US)-  U R:                  -
  S*-  US)-  /4[6        R>                  U R:                  US)-  -
  S*-  U* S)-  /4[6        R<                  U R:                  US)-  -
  S)-  U* S)-  /4[6        R<                  U R:                  US)-  -
  U* S)-  /4/n [6        R<                  US)-  U R:                  -
  US)-  /4/n![6        R<                  U R:                  US)-  -
  US)-  /4/n"[         R@                  " US+45      n#[         R@                  " US+45      n$[#        [%        UU[5        [%        X5      5      5      5       Hz  u  nu  nnnU[&        :X  a.  U(       a'  U RB                  " U"U/UQ76 u  U#USS24'   U$USS24'   MB  U[(        :X  d  MN  USL d  MU  U RD                  " UU/UQ76 u  U#USS24'   U$USS24'   M|     [#        [3        [5        [%        UU[5        [%        X5      5      5      5      5      5       H  u  nu  nnnU[(        :X  a>  U(       a7  U RB                  " U U/UQ76 u  n%n&U%U#UU-
  S-
  SS24'   U&U$UU-
  S-
  SS24'   MR  U[&        :X  d  M^  USL d  Me  U RD                  " U!U/UQ76 u  n%n&U%U#UU-
  S-
  SS24'   U&U$UU-
  S-
  SS24'   M     Sn[#        [3        [5        [%        UU[5        [%        X5      5      5      5      5      5       H  u  nu  nnnU[*        :X  d  M  U(       d  M  U(       dO  U S!   S   S   U"S!   S   S   :  a5  U RG                  [6        R<                  U"S!   S   S   U S!   S   S   /45        SnU RB                  " U U/UQ76 u  n%n&U%U#UU-
  S-
  SS24'   U&U$UU-
  S-
  SS24'   M     Sn[#        [%        UU[5        [%        X5      5      5      5       H  u  nu  nnnU[*        :X  d  M  USL d  M  U(       dO  US!   S   S   U!S!   S   S   :  a5  URG                  [6        R<                  U!S!   S   S   US!   S   S   /45        SnU RD                  " UU/UQ76 u  U#USS24'   U$USS24'   M     U(       d   U"RI                  5         U RI                  5         U(       d   U!RI                  5         URI                  5         UU RK                  U!5      -   U -   U RK                  U"5      -   [6        RL                  US   S   4/-   n'[%        U'6 u  n(n)[         R                  " U)5      n)S, n*Uc|  U	S:w  aW  U Vs/ s H  nU*" UU	5      PM     nn[O        5       RQ                  U	S--  5      RR                  n+U+" U#5      n#U+" U$5      n$U+" U)5      n)U RT                  RW                  SSUS.S.S/9n,GOU R                  U   R                   US      UUS      -
  n	U Vs/ s H  nU*" UU	5      PM     nn[O        5       RQ                  U	S--  5      RR                  n+U+" U#5      n#U R                  U   RX                  US      U#US      -
  n-[O        5       RZ                  " U-6 RR                  n.U." U#5      n#U." U+" U$5      5      n$U." U+" U)5      5      n)[/        US.S.S/9n/U RT                  RV                  " U-0 U/D6n,[\        R^                  S0   (       aE  U
RI                  S1U
RI                  S2S35      5      n0U
RI                  S4U
RI                  S5S65      5      n1ODU
RI                  S1U
RI                  S2S5      5      n0U
RI                  S4U
RI                  S5S5      5      n1U0c$  U RT                  R`                  Rc                  5       n0[e        [7        U)U(5      4U0U1S7.U
D6n2U RT                  Rg                  U25        / n3[%        UUUU$5       H  u  n4nn5n6U5b  Uc  S8n5OU Rh                  b  [k        U R                  [l        5      (       a&  U R                  [        U45      -  U Rh                  -   n7O7[o        U R                  5      (       a  U R                  U45      n7O[q        S95      eU5S8:w  a  U5S:-  n5U5U7-  n5U3RG                  U RT                  RW                  U6S   U6S   U5S.S.S;95        M     [        [         R                  " U)SS2S4   5      [         R                  " U$SS2S4   5      U Rr                  S   5      [u        [         Rt                  " U)SS2S4   5      [         Rt                  " U$SS2S4   5      U Rr                  S   5      [        [         R                  " U)SS2S4   5      [         R                  " U$SS2S4   5      U Rr                  S+   5      [u        [         Rt                  " U)SS2S4   5      [         Rt                  " U$SS2S4   5      U Rr                  S<   5      4U l9        U R                  RG                  [w        U2UUU#U,U3S=95        U $ ! [         a<    [	        S[         R                  " U5       S[         R                  " U5       S35      Sef = f! [         a<    [	        S[         R                  " U5       S	[         R                  " U5       S35      Sef = fs  snf s  snf s  snf )>u  
Add a simple Sankey diagram with flows at the same hierarchical level.

Parameters
----------
patchlabel : str
    Label to be placed at the center of the diagram.
    Note that *label* (not *patchlabel*) can be passed as keyword
    argument to create an entry in the legend.

flows : list of float
    Array of flow values.  By convention, inputs are positive and
    outputs are negative.

    Flows are placed along the top of the diagram from the inside out
    in order of their index within *flows*.  They are placed along the
    sides of the diagram from the top down and along the bottom from
    the outside in.

    If the sum of the inputs and outputs is
    nonzero, the discrepancy will appear as a cubic Bézier curve along
    the top and bottom edges of the trunk.

orientations : list of {-1, 0, 1}
    List of orientations of the flows (or a single orientation to be
    used for all flows).  Valid values are 0 (inputs from
    the left, outputs to the right), 1 (from and to the top) or -1
    (from and to the bottom).

labels : list of (str or None)
    List of labels for the flows (or a single label to be used for all
    flows).  Each label may be *None* (no label), or a labeling string.
    If an entry is a (possibly empty) string, then the quantity for the
    corresponding flow will be shown below the string.  However, if
    the *unit* of the main diagram is None, then quantities are never
    shown, regardless of the value of this argument.

trunklength : float
    Length between the bases of the input and output groups (in
    data-space units).

pathlengths : list of float
    List of lengths of the vertical arrows before break-in or after
    break-away.  If a single value is given, then it will be applied to
    the first (inside) paths on the top and bottom, and the length of
    all other arrows will be justified accordingly.  The *pathlengths*
    are not applied to the horizontal inputs and outputs.

prior : int
    Index of the prior diagram to which this diagram should be
    connected.

connect : (int, int)
    A (prior, this) tuple indexing the flow of the prior diagram and
    the flow of this diagram which should be connected.  If this is the
    first diagram or *prior* is *None*, *connect* will be ignored.

rotation : float
    Angle of rotation of the diagram in degrees.  The interpretation of
    the *orientations* argument will be rotated accordingly (e.g., if
    *rotation* == 90, an *orientations* entry of 1 means to/from the
    left).  *rotation* is ignored if this diagram is connected to an
    existing one (using *prior* and *connect*).

Returns
-------
Sankey
    The current `.Sankey` instance.

Other Parameters
----------------
**kwargs
   Additional keyword arguments set `matplotlib.patches.PathPatch`
   properties, listed below.  For example, one may want to use
   ``fill=False`` or ``label="A legend entry"``.

%(Patch:kwdoc)s

See Also
--------
Sankey.finish
Nr6   g      r   g     V@zThe shapes of 'flows' z and 'orientations' z are incompatiblez and 'labels' zR'trunklength' is negative, which is not allowed because it would cause poor layoutzWThe sum of the flows is nonzero (%f; patchlabel=%r); is the system not at steady state?c              3   :   #    U  H  n[        US 5      v   M     g7fr   N)max.0rQ   s     r1   	<genexpr>Sankey.add.<locals>.<genexpr>       9LD3tQ<<L   c              3   :   #    U  H  n[        US 5      v   M     g7frj   )minrl   s     r1   rn   ro     rp   rq   z*The index of the prior diagram is negativez2At least one of the connection indices is negativez"The index of the prior diagram is z, but there are only z other diagramszTThe connection index to the source diagram is {}, but that diagram has only {} flowsr	   z(The connection index to this diagram is z, but this diagram has only z flowszHThe connection cannot be made, which may occur if the magnitude of flow z of diagram z% is less than the specified tolerancez)The scaled sum of the connected flows is z%, which is not within the tolerance ()TFzwThe magnitude of flow %d (%f) is below the tolerance (%f).
It will not be shown, and it cannot be used in a connection.r8   zThe value of orientations[z] is z, but it must be -1, 0, or 1zThe lengths of 'flows' (z) and 'pathlengths' (z) are incompatible)rJ   r   g       @r7   c                     U c  g X-   $ )Nr   )ars     r1   
_get_angleSankey.add.<locals>._get_angle  s    yur4   Z   rB   )shavaz_internal.classic_modefc	facecolorz#bfd1d4lw	linewidthg      ?)r~   r    z*format must be callable or a format string
)rS   rT   r{   r|   r}   r
   )patchflowsanglestipstexttexts)<r"   r'   r?   broadcast_tor   abssumr&   _loginfor   rs   r*   r   r   r   r   	enumerater=   rM   rL   rJ   iterabledictgetreversedr<   r   MOVETOr   r9   r:   zerosrY   r^   rN   poprf   	CLOSEPOLYr   
rotate_degtransform_affiner   r   r   	translatemplrcParams_get_patches_for_fillget_next_colorr   	add_patchr   
isinstancestrcallable	TypeErrorr)   rk   r   )8r,   
patchlabelr   orientationslabelstrunklengthpathlengthspriorconnectrotationr.   nscaled_flowsgainloss
flow_error
are_inputsirQ   r   orientis_inputurlengthullengthlrlengthlllengthdrP   has_left_inputspechas_right_outputurpathllpathlrpathulpathr   label_locationsr]   rW   rO   codesrE   rx   rotater   r    r   kwdsr~   r   r   r   numberlabellocationquantitys8                                                           r1   r+   
Sankey.add^  s   n */#t%BHHUOKKNH HL	??<;L	__V/F ?*+ + rvve}.II ;ffUmZ1 zzE)9L999L99qy !MNN7|a HJ JDMM** 8 @  #DMM 23?DE E qzSu!5!;!;<< 55;V
Ce(<(B(B$C6EF F qzQ >wqzl K1126;< < }}U#**71:6> ))0L H89: : --.44WQZ@
+,J:$..0 ?
| L::>..9ILM M
 VaZ
 'GAtt~~% $
1$..( %
1		"#$dDNN< ( !%.s</L%M!A!{ $F1I& "F1I ' 1' %F1I ( R<$4QCuVH E5 67 7  "F1I& $F1I% &N* ;;{##;1$ .qc 2K());=> > %
 #H"H"H"H;'A8>?u155?K? /8FJ<H9J /K**E8TD=X%-KN$Hb[X%6%-KN$H/K /8c*lG4 B5 96 /7**E8TB;8-5KA	*$Hd]x5'8-5KA	*$H/7 #N.7c*c,&DGF BG 9H /I**E8TE>x)56KA	2-1N/I  %.7*d3|+I&J9L /M**E8TE>5(+-.KN/3,/M ;;$(([3->">!%!- .;;$(([3->">#!E!%!- .;;$(([3->">#!E!%!- .;;+"3dhh">#!E"&!. /;;+"3dhh">#!E"&!. /;;+"3dhh">"&!. /0 ;;+"3dhh">!%!- .;;+"3dhh">#!E!%!- .;;+"3dhh">#!E!%!- .;;$(([3->">#!E"&!. /;;$(([3->">#!E"&!. /;;$(([3->">"&!. /0 ;;+"3dhh">!%!- . /;;K#,=!=!%!- . / xxA((Aq6**3Cj$s<'E"F5H +I&A&x}48OOE5*$(5*1QT
OAqD1"U!2484D4DE5*$(5*1QT
OAqD1+I +4HT#j$s<'E"FCH >I 5J +K&A&x{x&*oofe&Kd&K#^%(QUQY\"0>A	1-$8u#4&*&6&6vu&Lt&L#^%(QUQY\"0>A	1-+K *3HT#j$s<'E"FCH >I 5J +K&A&x~((% bz!}Q'&*Q-*::t{{VBZ]15E5;BZ]15E5G 'H I%)N&*oofe&Kd&K#^%(QUQY\"0>A	1-+K !*3Cj$s<'E"F5H +I&A&x~(e"3' bz!}Q'&*Q-*::t{{VBZ]15E5;BZ]15E5G 'H I'+$484D4DE5*$(5*1QT
OAqD1+I JJLJJLJJLJJL f--6f9MM..&)A,/01 t*x88H%	 =1}CIJ6%*UH56J!..x"}=NNd|"("9!(+77<<1
xH<MDe,33GAJ?wqz*+H?EFvej1vFFZ**8b=9JJF$<D]]5)..wqz:T'!*=MMF 
,,f5FFIT?D'(?@O !12H*h?D77<<040D<<01D&**[)"DEBD&**[#">?BD&**[$"?@BD&**[$"?@B:..==?B$x/HB2HH%  .1%2A/C*FE5(}&dkk3//#{{S[8499DHdkk**#{{62H#DF FB;TME!LLx{(-)1h & @ A/C. 266(1a4.166/!Q$"78;;q>+ 266(1a4.166/!Q$"78;;q>+ 266(1a4.166/!Q$"78;;q>+ 266(1a4.166/!Q$"78;;q>+,  	%uV$!%U4	5
 Q
  	(%(99M88L)**;= 	  	(%(988F#$$57 	| @n K Gs5   AC+ )AD4 AE=AF<AFC+AAD1D4AAE:c                 \   U R                   R                  U R                  S   U R                  -
  U R                  S   U R                  -   U R                  S   U R                  -
  U R                  S   U R                  -   /5        U R                   R	                  SSS9  U R
                  $ )a  
Adjust the Axes and return a list of information about the Sankey
subdiagram(s).

Returns a list of subdiagrams with the following fields:

========  =============================================================
Field     Description
========  =============================================================
*patch*   Sankey outline (a `~matplotlib.patches.PathPatch`).
*flows*   Flow values (positive for input, negative for output).
*angles*  List of angles of the arrows [deg/90].
          For example, if the diagram has not been rotated,
          an input to the top side has an angle of 3 (DOWN),
          and an output from the top side has an angle of 1 (UP).
          If a flow has been skipped (because its magnitude is less
          than *tolerance*), then its angle will be *None*.
*tips*    (N, 2)-array of the (x, y) positions of the tips (or "dips")
          of the flow paths.
          If the magnitude of a flow is less the *tolerance* of this
          `Sankey` instance, the flow is skipped and its tip will be at
          the center of the diagram.
*text*    `.Text` instance for the diagram label.
*texts*   List of `.Text` instances for the flow labels.
========  =============================================================

See Also
--------
Sankey.add
r   r	   r7   r
   equaldatalim)
adjustable)r   axisr)   r!   
set_aspectr   )r,   s    r1   finishSankey.finish
  s    > 	dkk!nt{{2kk!nt{{2kk!nt{{2kk!nt{{24 	5 	7y9}}r4   )r   r   r)   r   r   r!   r    r%   r   r   r   r&   r   )Nr6   r   z%G      ?g?gQ?g333333?d   g?gư>)r   Tr	   r   r   )	r   NNr   r6   r   Nr   r   )__name__
__module____qualname____firstlineno____doc__r2   rF   rY   r^   r   r9   rf   r   interpdr+   r   __static_attributes__r   r4   r1   r   r      sg    	 FJDG'+}~7Fr2'h4'l *. 
$ GICIi iV$r4   r   )r   loggingtypesr   numpyr"   
matplotlibr   matplotlib.pathr   matplotlib.patchesr   matplotlib.transformsr   r   	getLoggerr   r   
__author____credits____license____version__rJ   rL   rM   r   r   r4   r1   <module>r      sh     !     ( * !"
 	
P Pr4   