§
    †Ûg]  ã                   ó<   — d Z ddlZddlZddlmZ dgZddddœd„ZdS )	z¨
Stacked area plot for 1D arrays inspired by Douglas Y'barbo's stackoverflow
answer:
https://stackoverflow.com/q/2225995/

(https://stackoverflow.com/users/66549/doug)
é    N)Ú_apiÚ	stackplot© Úzero)ÚlabelsÚcolorsÚbaselinec                óŠ  ‡ — t          j        |¦  «        }t          |¦  «        }|�t          j        |¦  «        }nˆ fd„|D ¦   «         }t          j        |dt          j        |j        t           j        ¦  «        ¬¦  «        }t          j
        g d¢|¬¦  «         |dk    rd}	�nW|d	k    r*t          j        |d¦  «         d
z  }	||	ddd…f         z  }�n'|dk    rS|j        d         }
||
d
z
  t          j        |
¦  «        dd…df         z
  z                       d¦  «        }	|	|
 z  }	||	z  }nÎ|dk    rÈt          j        |d¦  «        }t          j        |¦  «        }|dk    }d||         z  ||<   t          j        |dd…dd…f         t          j        |¦  «        f¦  «        }||z
  }|d
|z  z  }||z  }d
|dd…df<   |d
z
  |z  }t          j        |                     d¦  «        ¦  «        }|d
|z  z
  }	||	z  } ‰ j        ||	|ddd…f         ft%          |¦  «        t%          |d¦  «        dœ|¤Ž}dg|j        j        dd…<   |g}t+          t-          |¦  «        dz
  ¦  «        D ]Z}|                      ‰ j        |||dd…f         ||dz   dd…f         ft%          |¦  «        t%          |d¦  «        dœ|¤Ž¦  «         Œ[|S )aÚ  
    Draw a stacked area plot.

    Parameters
    ----------
    x : (N,) array-like

    y : (M, N) array-like
        The data is assumed to be unstacked. Each of the following
        calls is legal::

            stackplot(x, y)           # where y has shape (M, N)
            stackplot(x, y1, y2, y3)  # where y1, y2, y3, y4 have length N

    baseline : {'zero', 'sym', 'wiggle', 'weighted_wiggle'}
        Method used to calculate the baseline:

        - ``'zero'``: Constant zero baseline, i.e. a simple stacked plot.
        - ``'sym'``:  Symmetric around zero and is sometimes called
          'ThemeRiver'.
        - ``'wiggle'``: Minimizes the sum of the squared slopes.
        - ``'weighted_wiggle'``: Does the same but weights to account for
          size of each layer. It is also called 'Streamgraph'-layout. More
          details can be found at http://leebyron.com/streamgraph/.

    labels : list of str, optional
        A sequence of labels to assign to each data series. If unspecified,
        then no labels will be applied to artists.

    colors : list of color, optional
        A sequence of colors to be cycled through and used to color the stacked
        areas. The sequence need not be exactly the same length as the number
        of provided *y*, in which case the colors will repeat from the
        beginning.

        If not specified, the colors from the Axes property cycle will be used.

    data : indexable object, optional
        DATA_PARAMETER_PLACEHOLDER

    **kwargs
        All other keyword arguments are passed to `.Axes.fill_between`.

    Returns
    -------
    list of `.PolyCollection`
        A list of `.PolyCollection` instances, one for each element in the
        stacked area plot.
    Nc              3   óJ   •K  — | ]}‰j                              ¦   «         V — Œd S )N)Ú
_get_linesÚget_next_color)Ú.0Ú_Úaxess     €úJ/granary/edev/quantum/lib/python3.11/site-packages/matplotlib/stackplot.pyú	<genexpr>zstackplot.<locals>.<genexpr>M   s1   øè è € Ð>Ð>°q�$”/×0Ò0Ñ2Ô2Ð>Ð>Ð>Ð>Ð>Ð>ó    r   )ÚaxisÚdtype)r   ÚsymÚwiggleÚweighted_wiggle)r	   r   g        r   g      à?r   r   g      ð?é   )Ú	facecolorÚlabel)ÚnpÚ	row_stackÚiterÚ	itertoolsÚcycleÚcumsumÚpromote_typesr   Úfloat32r   Úcheck_in_listÚsumÚshapeÚarangeÚ
zeros_likeÚhstackÚdiffÚfill_betweenÚnextÚsticky_edgesÚyÚrangeÚlenÚappend)r   Úxr   r   r	   ÚargsÚkwargsr.   ÚstackÚ
first_lineÚmÚtotalÚ	inv_totalÚmaskÚincreaseÚ
below_sizeÚmove_upÚcenterÚcollÚrÚis   `                    r   r   r      sB  ø€ õj 	Œ�TÑÔ€Aå�&‰\Œ\€FØÐÝ” Ñ(Ô(ˆˆà>Ð>Ð>Ð>¸AÐ>Ñ>Ô>ˆõ ŒI�a˜a¥rÔ'7¸¼ÅÄÑ'LÔ'LÐMÑMÔM€EåÔÐCÐCÐCØ (ð*ñ *ô *ð *à�6ÒÐØˆ
‰
à	�UÒ	Ð	Ý”f˜Q ‘l”l�] SÑ(ˆ
Ø�˜D ! ! !˜GÔ$Ñ$ˆ‰à	�XÒ	Ð	ØŒG�AŒJˆØ˜1˜s™7¥R¤Y¨q¡\¤\°!°!°!°T°'Ô%:Ñ:Ñ;×@Ò@ÀÑCÔCˆ
Ø�q�bÑˆ
Ø�Ñˆˆà	Ð&Ò	&Ð	&Ý”�q˜!‘”ˆå”M %Ñ(Ô(ˆ	Ø�qŠyˆØ  d¤Ñ+ˆ	�$‰Ý”9˜a    1 Q 3 œi­¬°©¬Ð4Ñ5Ô5ˆØ˜U‘]ˆ
Ø�c˜A‘gÑˆ
Ø˜yÑ(ˆØˆ����1�‰Ø˜C‘- 8Ñ+ˆÝ”˜6Ÿ:š: a™=œ=Ñ)Ô)ˆØ˜c E™kÑ)ˆ
Ø�Ñˆð ˆ4Ô˜Q 
¨E°!°Q°Q°Q°$¬Kð 'Ý'+¨F¡|¤|½4ÀÈÑ;MÔ;Mð'ð 'à%ð'ð '€Dð  ˜S€DÔÔ˜˜˜ÑØ	ˆ€Aõ •3�q‘6”6˜A‘:ÑÔð .ð .ˆØ	�ŠÐ"�Ô" 1 e¨A¨q¨q¨q¨D¤k°5¸¸Q¹ÀÀÀ¸´?ð -Ý-1°&©\¬\Ý)-¨f°dÑ);Ô);ð-ð -ð &,ð-ð -ñ 	.ô 	.ð 	.ð 	.ð €Hr   )Ú__doc__r   Únumpyr   Ú
matplotlibr   Ú__all__r   r   r   r   ú<module>rF      su   ððð ð Ð Ð Ð à Ð Ð Ð à Ð Ð Ð Ð Ð àˆ-€ð  ¨vðmð mð mð mð mð mð mr   