
    hc                       S SK r S SKrS SKrS SKrS SKJrJrJr  S SKrS SK	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  S SKJ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(  S SK)J*r+  S SK,J-r-  S SK.J/r0  S SK1J2r3  S SK4J5r6  S SK7J8r9  S SK:J;r<  S SK=J>r?  S SK@JArB  S SKCJDrE  S SKFJGrH  S SKIJJrK  S SKLJMrN  S SKJOrOJPrPJQrQ  S SKRJSrSJTrTJUrU  S SKVJWrW  S SKXJYrYJZrZJ[r[  S SKFJ\r\  \R                  " \^5      r_S r`\PR                   " S	 S
\S5      5       rbg)    N)IntegralNumberReal)_api
_docstring_preprocess_data)	_AxesBase_TransformedBoundsLocator_process_plot_format)SecondaryAxis)BarContainerErrorbarContainerStemContainer)_ScaledRotationc                 .    SU R                    3U l        U $ )a  
Patch the qualname for functions that are directly added to Axes.

Some Axes functionality is defined in functions in other submodules.
These are simply added as attributes to Axes. As a result, their
``__qualname__`` is e.g. only "table" and not "Axes.table". This
function fixes that.

Note that the function itself is patched, so that
``matplotlib.table.table.__qualname__` will also show "Axes.table".
However, since these functions are not intended to be standalone,
this is bearable.
zAxes.)__name____qualname__)funcs    G/var/www/html/env/lib/python3.13/site-packages/matplotlib/axes/_axes.py_make_axes_methodr   1   s      /DK    c                      \ rS rSrSrSS jrSSS.S jjrSS jr\R                  S	 5       r
S
 rSSS.S jr\R                  SSSSSSS.S jj5       rS r\R                  SSS.S jj5       r\R                  SSS.S jj5       r\R                  SS j5       r\R                    SS j5       r\R(                  R*                  R                  \l        \R                  SS j5       r\R                  SS j5       r\S 5       r\R                  SSS.S jj5       r\R                  SS j5       r\R                  SS  j5       r\R<                  " S!S"5      \" / S#QS$S%9  SS& j5       5       r \R<                  " S!S"5      \" / S'QS(S%9  SS) j5       5       r!\R<                  " S!S*5      \" / S+QS,9\R                     SS. j5       5       5       r"\R                  S/S/SS0.S1 j5       r#\RH                  " S!S2S39\" S(S$/S$S%9\R                  SS5 j5       5       5       r%\R                  S6 5       r&\R                  S7 5       r'\R                  S8 5       r(\" S(/S(S%9S9 5       r)\R<                  " S!S:5      \" S(S$/S$S%9S/\*RV                  S/S;4S< j5       5       r,S=SS>.S? jr-\S@ 5       r.SA r/\" 5       \R                  SSSB.SC jj5       5       r0\R                  SSSSD.SE jj5       r1SSFSGSSH.SI jjr2\" 5       \R                  SJ 5       5       r3\" 5       SSSSSSKSL.SM j5       r4\R<                  " S!SN5      \" / SOQS,9     SS/SSP.SQ jj5       5       r5\SR 5       r6\R<                  " S!SS5      \" / STQS$S%9\R                      SSU j5       5       5       r7\R<                  " S!SV5      \" 5       \Rp                  " S!SWSX5                SSY j5       5       5       r9\R<                  " S!SZ5             SS[ j5       r:\S\ 5       r;\R<                  " S!S]5      \" / S^QS$S%9\R                    SSSS4S_.S` jj5       5       5       r<\R<                  " S!Sa5      \" / SbQS$S%9\R                  SScSSdSdSSSSSSSSe\=R|                  SS4S4Sf j5       5       5       r?\R                  Sg 5       r@\R                  " \BR                  R*                  5      Sh 5       rDSi rE\" 5       \R                  Sj 5       5       rF\" 5       \R                  Sk 5       5       rGSSl.Sm jrH SSS4SSn.So jjrISp rJ  SSq jrK\IR                  (       a   \IR                  R                  S-S(S$Sr9\Kl        \" \R                  " \K5      / SsQS,9rK  SSt jrM\IR                  (       a   \IR                  R                  SKS$S(Sr9\Ml        \" \R                  " \M5      / SuQS,9rM\" 5       \R                  SSSSSSSSSSS/SvSSSw.Sx jj5       5       rNSySz.S{ jrO\" 5       \R                  SSSSSSSS|.S} j5       5       rP\" 5       \R                  SSSSSSSS4S~.S j5       5       rQ\" 5       \R                  SSSSSSS.S j5       5       rR\" 5       \R                  S 5       5       rS\" 5       \R                  S 5       5       rTSS jrU\R<                  " S!S5      \" S(S/S(S%9    SS j5       5       rV\" 5       SSKSS4S.S jj5       rW\R<                  " S!S5      \" / SQS,9\R                    SS j5       5       5       rX\" S(S/S(S%9\R                  SS4SKS4S.S jj5       5       rY\R<                  " S!S5      \" S(/S,9\R                     SS j5       5       5       rZ\R<                  " S!S5      \" S(S$/S$S%9\R                     SS j5       5       5       r[\R<                  " S!S5      \" S(/S,9\R                    SS j5       5       5       r\\R<                  " S!S5      \" S(/S,9\R                    SS j5       5       5       r]\R<                  " S!S5      \" S(/S,9\R                    SS j5       5       5       r^\R<                  " S!S5      \" S(S$/S,9\R                  SSS\*RV                  \*R                  SSSS4	S j5       5       5       r`\R<                  " S!S5      \" S(/S,9\R                       SS j5       5       5       ra\R<                  " S!S5      \R                    SS j5       5       rbS rc\R<                  " S!S5      \" S/S,9    SS j5       5       rd\R<                  " S!S5         SS j5       re\f" \gR                  5      rh\" 5       " \f" \iR                  5      5      rj\" / SQS,9" \f" \kR                  5      5      rl\f" \mR                  5      rn\f" \mR                  5      ro\f" \mR                  5      rp\f" \mR                  5      rqS rrSrsg)AxesC   a-  
An Axes object encapsulates all the elements of an individual (sub-)plot in
a figure.

It contains most of the (sub-)plot elements: `~.axis.Axis`,
`~.axis.Tick`, `~.lines.Line2D`, `~.text.Text`, `~.patches.Polygon`, etc.,
and sets the coordinate system.

Like all visible elements in a figure, Axes is an `.Artist` subclass.

The `Axes` instance supports callbacks through a callbacks attribute which
is a `~.cbook.CallbackRegistry` instance.  The events you can connect to
are 'xlim_changed' and 'ylim_changed' and the callback will be called with
func(*ax*) where *ax* is the `Axes` instance.

.. note::

    As a user, you do not instantiate Axes directly, but use Axes creation
    methods instead; e.g. from `.pyplot` or `.Figure`:
    `~.pyplot.subplots`, `~.pyplot.subplot_mosaic` or `.Figure.add_axes`.

centerc                     U R                   U R                  U R                  S.n[        R                  " X!R                  5       S9nUR                  5       $ )aY  
Get an Axes title.

Get one of the three available Axes titles. The available titles
are positioned above the Axes in the center, flush with the left
edge, and flush with the right edge.

Parameters
----------
loc : {'center', 'left', 'right'}, str, default: 'center'
    Which title to return.

Returns
-------
str
    The title text string.

leftr   rightloc)_left_titletitle_right_titler   check_getitemlowerget_text)selfr!   titlesr#   s       r   	get_titleAxes.get_title]   sI    & ** JJ,,. ""6yy{;~~r   N)yc                   Uc  [         R                  S   nUc  [         R                  S   nUc  SnOSU l        XVS'   U R                  U R                  U R
                  S.n[        R                  " XsR                  5       S9n[         R                  S   [         R                  S	   S
UR                  5       S.n	[         R                  S   n
[        R                  " U
S5      (       d  XS'   Uc  [         R                  S   nU R                  [        U5      5        UR                  U5        UR                  U	5        Ub  UR                  U5        UR                  U5        U$ )a  
Set a title for the Axes.

Set one of the three available Axes titles. The available titles
are positioned above the Axes in the center, flush with the left
edge, and flush with the right edge.

Parameters
----------
label : str
    Text to use for the title

fontdict : dict

    .. admonition:: Discouraged

       The use of *fontdict* is discouraged. Parameters should be passed as
       individual keyword arguments or using dictionary-unpacking
       ``set_title(..., **fontdict)``.

    A dictionary controlling the appearance of the title text,
    the default *fontdict* is::

       {'fontsize': rcParams['axes.titlesize'],
        'fontweight': rcParams['axes.titleweight'],
        'color': rcParams['axes.titlecolor'],
        'verticalalignment': 'baseline',
        'horizontalalignment': loc}

loc : {'center', 'left', 'right'}, default: :rc:`axes.titlelocation`
    Which title to set.

y : float, default: :rc:`axes.titley`
    Vertical Axes location for the title (1.0 is the top).  If
    None (the default) and :rc:`axes.titley` is also None, y is
    determined automatically to avoid decorators on the Axes.

pad : float, default: :rc:`axes.titlepad`
    The offset of the title from the top of the Axes, in points.

Returns
-------
`.Text`
    The matplotlib text instance representing the title

Other Parameters
----------------
**kwargs : `~matplotlib.text.Text` properties
    Other keyword arguments are text properties, see `.Text` for a list
    of valid text properties.
zaxes.titlelocationzaxes.titley      ?Fr,   r   r    zaxes.titlesizezaxes.titleweightbaseline)fontsize
fontweightverticalalignmenthorizontalalignmentzaxes.titlecolorautocolorzaxes.titlepad)mplrcParams_autotitleposr"   r#   r$   r   r%   r&   cbook_str_lower_equal_set_title_offset_transfloatset_textupdate_internal_update)r(   labelfontdictr!   padr,   kwargsr)   r#   default
titlecolors              r   	set_titleAxes.set_titlev   s8   j ;,,34C9]+A9A!&Ds** JJ,,. ""6yy{;%56,,'9:!+#&99;	0
 \\"34
%%j&99)G;,,/C$$U3Z0uWLL"v&r   c                 <    [         R                  " U /U5      u  p#X#4$ )z
Return handles and labels for legend

``ax.legend()`` is equivalent to ::

  h, l = ax.get_legend_handles_labels()
  ax.legend(h, l)
)mlegend_get_legend_handles_labels)r(   legend_handler_maphandleslabelss       r   get_legend_handles_labelsAxes.get_legend_handles_labels   s&     "<<F&(r   c                     [         R                  " U //UQ70 UD6u  p4n[         R                  " XU40 UD6U l        U R                  U R                  l        U R                  $ )a  
Place a legend on the Axes.

Call signatures::

    legend()
    legend(handles, labels)
    legend(handles=handles)
    legend(labels)

The call signatures correspond to the following different ways to use
this method:

**1. Automatic detection of elements to be shown in the legend**

The elements to be added to the legend are automatically determined,
when you do not pass in any extra arguments.

In this case, the labels are taken from the artist. You can specify
them either at artist creation or by calling the
:meth:`~.Artist.set_label` method on the artist::

    ax.plot([1, 2, 3], label='Inline label')
    ax.legend()

or::

    line, = ax.plot([1, 2, 3])
    line.set_label('Label via method')
    ax.legend()

.. note::
    Specific artists can be excluded from the automatic legend element
    selection by using a label starting with an underscore, "_".
    A string starting with an underscore is the default label for all
    artists, so calling `.Axes.legend` without any arguments and
    without setting the labels manually will result in a ``UserWarning``
    and an empty legend being drawn.


**2. Explicitly listing the artists and labels in the legend**

For full control of which artists have a legend entry, it is possible
to pass an iterable of legend artists followed by an iterable of
legend labels respectively::

    ax.legend([line1, line2, line3], ['label1', 'label2', 'label3'])


**3. Explicitly listing the artists in the legend**

This is similar to 2, but the labels are taken from the artists'
label properties. Example::

    line1, = ax.plot([1, 2, 3], label='label1')
    line2, = ax.plot([1, 2, 3], label='label2')
    ax.legend(handles=[line1, line2])


**4. Labeling existing plot elements**

.. admonition:: Discouraged

    This call signature is discouraged, because the relation between
    plot elements and labels is only implicit by their order and can
    easily be mixed up.

To make a legend for all artists on an Axes, call this function with
an iterable of strings, one for each legend item. For example::

    ax.plot([1, 2, 3])
    ax.plot([5, 6, 7])
    ax.legend(['First line', 'Second line'])


Parameters
----------
handles : list of (`.Artist` or tuple of `.Artist`), optional
    A list of Artists (lines, patches) to be added to the legend.
    Use this together with *labels*, if you need full control on what
    is shown in the legend and the automatic mechanism described above
    is not sufficient.

    The length of handles and labels should be the same in this
    case. If they are not, they are truncated to the smaller length.

    If an entry contains a tuple, then the legend handler for all Artists in the
    tuple will be placed alongside a single label.

labels : list of str, optional
    A list of labels to show next to the artists.
    Use this together with *handles*, if you need full control on what
    is shown in the legend and the automatic mechanism described above
    is not sufficient.

Returns
-------
`~matplotlib.legend.Legend`

Other Parameters
----------------
%(_legend_kw_axes)s

See Also
--------
.Figure.legend

Notes
-----
Some artists are not supported by this function.  See
:ref:`legend_guide` for details.

Examples
--------
.. plot:: gallery/text_labels_and_annotations/legend.py
)rI   _parse_legend_argsLegendlegend__remove_legend_remove_method)r(   argsrC   rL   rM   s        r   legendAxes.legend   sY    l #*"<"<dV"Ud"Uf"U~~dVFvF&*&9&9#||r   c                     S U l         g N)rS   )r(   rW   s     r   rT   Axes._remove_legendU  s	    r      )	transformzorderc                $   Uc  U R                   nUR                  SS5        [        X5      nU" U S5      R                  nU R	                  SS9nUR
                  " S0 UD6u  pxU" Xa4SU0UD6n	U	R                  U5        U R                  U	5        U	$ )a  
Add a child inset Axes to this existing Axes.


Parameters
----------
bounds : [x0, y0, width, height]
    Lower-left corner of inset Axes, and its width and height.

transform : `.Transform`
    Defaults to `ax.transAxes`, i.e. the units of *rect* are in
    Axes-relative coordinates.

projection : {None, 'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', 'rectilinear', str}, optional
    The projection type of the inset `~.axes.Axes`. *str* is the name
    of a custom projection, see `~matplotlib.projections`. The default
    None results in a 'rectilinear' projection.

polar : bool, default: False
    If True, equivalent to projection='polar'.

axes_class : subclass type of `~.axes.Axes`, optional
    The `.axes.Axes` subclass that is instantiated.  This parameter
    is incompatible with *projection* and *polar*.  See
    :ref:`axisartist_users-guide-index` for examples.

zorder : number
    Defaults to 5 (same as `.Axes.legend`).  Adjust higher or lower
    to change whether it is above or below data plotted on the
    parent Axes.

**kwargs
    Other keyword arguments are passed on to the inset Axes class.

Returns
-------
ax
    The created `~.axes.Axes` instance.

Examples
--------
This example makes two inset Axes, the first is in Axes-relative
coordinates, and the second in data-coordinates::

    fig, ax = plt.subplots()
    ax.plot(range(10))
    axin1 = ax.inset_axes([0.8, 0.1, 0.15, 0.15])
    axin2 = ax.inset_axes(
            [5, 7, 2.3, 2.3], transform=ax.transData)

Nr@   
inset_axesF)rootr^    )	transAxes
setdefaultr
   bounds
get_figure _process_projection_requirementsset_axes_locatoradd_child_axes)
r(   re   r]   r^   rC   inset_locatorfigprojection_classpkwinset_axs
             r   r`   Axes.inset_axesX  s    j I'<0 2&DtT*11oo5o) # D D Nv N#CFF#F 	!!-0H%r   nonez0.5      ?)r]   	facecolor	edgecoloralphar^   c          
          U R                  5         Uc  U R                  nUR                  SS5        [        R                  " U4UXEUXsS.UD6n	U R                  U	5        U	$ )a  
Add an inset indicator to the Axes.  This is a rectangle on the plot
at the position indicated by *bounds* that optionally has lines that
connect the rectangle to an inset Axes (`.Axes.inset_axes`).

Warnings
--------
This method is experimental as of 3.0, and the API may change.

Parameters
----------
bounds : [x0, y0, width, height], optional
    Lower-left corner of rectangle to be marked, and its width
    and height.  If not set, the bounds will be calculated from the
    data limits of *inset_ax*, which must be supplied.

inset_ax : `.Axes`, optional
    An optional inset Axes to draw connecting lines to.  Two lines are
    drawn connecting the indicator box to the inset Axes on corners
    chosen so as to not overlap with the indicator box.

transform : `.Transform`
    Transform for the rectangle coordinates. Defaults to
    ``ax.transAxes``, i.e. the units of *rect* are in Axes-relative
    coordinates.

facecolor : :mpltype:`color`, default: 'none'
    Facecolor of the rectangle.

edgecolor : :mpltype:`color`, default: '0.5'
    Color of the rectangle and color of the connecting lines.

alpha : float or None, default: 0.5
    Transparency of the rectangle and connector lines.  If not
    ``None``, this overrides any alpha value included in the
    *facecolor* and *edgecolor* parameters.

zorder : float, default: 4.99
    Drawing order of the rectangle and connector lines.  The default,
    4.99, is just below the default level of inset Axes.

**kwargs
    Other keyword arguments are passed on to the `.Rectangle` patch:

    %(Rectangle:kwdoc)s

Returns
-------
inset_indicator : `.inset.InsetIndicator`
    An artist which contains

    inset_indicator.rectangle : `.Rectangle`
        The indicator frame.

    inset_indicator.connectors : 4-tuple of `.patches.ConnectionPatch`
        The four connector lines connecting to (lower_left, upper_left,
        lower_right upper_right) corners of *inset_ax*. Two lines are
        set with visibility to *False*,  but the user can set the
        visibility to True if the automatic choice is not deemed correct.

    .. versionchanged:: 3.10
        Previously the rectangle and connectors tuple were returned.
r@   _indicate_inset)rn   rr   rs   rt   r^   r]   )apply_aspect	transDatard   minsetInsetIndicator
add_artist)
r(   re   rn   r]   rr   rs   rt   r^   rC   indicator_patchs
             r   indicate_insetAxes.indicate_inset  sr    J 	I'#45 //:%E: 39: 	(r   c                 *    U R                   " SU40 UD6$ )a|  
Add an inset indicator rectangle to the Axes based on the axis
limits for an *inset_ax* and draw connectors between *inset_ax*
and the rectangle.

Warnings
--------
This method is experimental as of 3.0, and the API may change.

Parameters
----------
inset_ax : `.Axes`
    Inset Axes to draw connecting lines to.  Two lines are
    drawn connecting the indicator box to the inset Axes on corners
    chosen so as to not overlap with the indicator box.

**kwargs
    Other keyword arguments are passed on to `.Axes.indicate_inset`

Returns
-------
inset_indicator : `.inset.InsetIndicator`
    An artist which contains

    inset_indicator.rectangle : `.Rectangle`
        The indicator frame.

    inset_indicator.connectors : 4-tuple of `.patches.ConnectionPatch`
        The four connector lines connecting to (lower_left, upper_left,
        lower_right upper_right) corners of *inset_ax*. Two lines are
        set with visibility to *False*,  but the user can set the
        visibility to True if the automatic choice is not deemed correct.

    .. versionchanged:: 3.10
        Previously the rectangle and connectors tuple were returned.
N)r}   )r(   rn   rC   s      r   indicate_inset_zoomAxes.indicate_inset_zoom  s    L ""4<V<<r   )r]   c                    US;   d   [        U[        5      (       d  [        S5      e[        U SXU40 UD6nU R	                  U5        U$ )a,  
Add a second x-axis to this `~.axes.Axes`.

For example if we want to have a second scale for the data plotted on
the xaxis.

%(_secax_docstring)s

Examples
--------
The main axis shows frequency, and the secondary axis shows period.

.. plot::

    fig, ax = plt.subplots()
    ax.loglog(range(1, 360, 5), range(1, 360, 5))
    ax.set_xlabel('frequency [Hz]')

    def invert(x):
        # 1/x with special treatment of x == 0
        x = np.array(x).astype(float)
        near_zero = np.isclose(x, 0)
        x[near_zero] = np.inf
        x[~near_zero] = 1 / x[~near_zero]
        return x

    # the inverse of 1/x is itself
    secax = ax.secondary_xaxis('top', functions=(invert, invert))
    secax.set_xlabel('Period [s]')
    plt.show()

To add a secondary axis relative to your data, you can pass a transform
to the new axis.

.. plot::

    fig, ax = plt.subplots()
    ax.plot(range(0, 5), range(-1, 4))

    # Pass 'ax.transData' as a transform to place the axis
    # relative to your data at y=0
    secax = ax.secondary_xaxis(0, transform=ax.transData)
)topbottomzAsecondary_xaxis location must be either a float or "top"/"bottom"x
isinstancer   
ValueErrorr   ri   r(   location	functionsr]   rC   secondary_axs         r   secondary_xaxisAxes.secondary_xaxis  s]    Z --Hd1K1K 9 : : %T3%.:28:L)r   c                    US;   d   [        U[        5      (       d  [        S5      e[        U SXU40 UD6nU R	                  U5        U$ )a:  
Add a second y-axis to this `~.axes.Axes`.

For example if we want to have a second scale for the data plotted on
the yaxis.

%(_secax_docstring)s

Examples
--------
Add a secondary Axes that converts from radians to degrees

.. plot::

    fig, ax = plt.subplots()
    ax.plot(range(1, 360, 5), range(1, 360, 5))
    ax.set_ylabel('degrees')
    secax = ax.secondary_yaxis('right', functions=(np.deg2rad,
                                                   np.rad2deg))
    secax.set_ylabel('radians')

To add a secondary axis relative to your data, you can pass a transform
to the new axis.

.. plot::

    fig, ax = plt.subplots()
    ax.plot(range(0, 5), range(-1, 4))

    # Pass 'ax.transData' as a transform to place the axis
    # relative to your data at x=3
    secax = ax.secondary_yaxis(3, transform=ax.transData)
)r   r   zAsecondary_yaxis location must be either a float or "left"/"right"r,   r   r   s         r   secondary_yaxisAxes.secondary_yaxisQ  s]    F --Hd1K1K 9 : : %T3%.:28:L)r   c                     SSU R                   SS.Ub  UO0 EUEn[        R                  " X4SU0UD6nUR                  5       c  UR	                  U R
                  5        U R                  U5        U$ )a  
Add text to the Axes.

Add the text *s* to the Axes at location *x*, *y* in data coordinates,
with a default ``horizontalalignment`` on the ``left`` and
``verticalalignment`` at the ``baseline``. See
:doc:`/gallery/text_labels_and_annotations/text_alignment`.

Parameters
----------
x, y : float
    The position to place the text. By default, this is in data
    coordinates. The coordinate system can be changed using the
    *transform* parameter.

s : str
    The text.

fontdict : dict, default: None

    .. admonition:: Discouraged

       The use of *fontdict* is discouraged. Parameters should be passed as
       individual keyword arguments or using dictionary-unpacking
       ``text(..., **fontdict)``.

    A dictionary to override the default text properties. If fontdict
    is None, the defaults are determined by `.rcParams`.

Returns
-------
`.Text`
    The created `.Text` instance.

Other Parameters
----------------
**kwargs : `~matplotlib.text.Text` properties.
    Other miscellaneous text parameters.

    %(Text:kwdoc)s

Examples
--------
Individual keyword arguments can be used to override any given
parameter::

    >>> text(x, y, s, fontsize=12)

The default transform specifies that text is in data coords,
alternatively, you can specify text in axis coords ((0, 0) is
lower-left and (1, 1) is upper-right).  The example below places
text in the center of the Axes::

    >>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center',
    ...      verticalalignment='center', transform=ax.transAxes)

You can put a rectangular box around the text instance (e.g., to
set a background color) by using the keyword *bbox*.  *bbox* is
a dictionary of `~matplotlib.patches.Rectangle`
properties.  For example::

    >>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
r/   r   F)r2   r3   r]   clip_ontext)rx   mtextTextget_clip_pathset_clip_pathpatch	_add_text)r(   r   r,   srA   rC   effective_kwargsts           r   r   	Axes.text}  s    D ",#)	

 $/xR
 
 JJq8!8'78??$OODJJ'qr   c           	      ,   [         R                  " X4X4XVUS.UD6n	U	R                  [        R                  " 5       5        UR                  SS5      (       a,  U	R                  5       c  U	R                  U R                  5        U R                  U	5        U	$ )N)xytextxycoords
textcoords
arrowpropsannotation_clipr   F)
r   
Annotationset_transformmtransformsIdentityTransformgetr   r   r   r   )
r(   r   xyr   r   r   r   r   rC   as
             r   annotateAxes.annotate  s    
 T Hf(2-<H@FH 	
5578::i''AOO,=,EOODJJ'qr   r   c                    U R                  X#/SS/5        SU;   a  [        S5      eU R                  5       u  pVU R                  SU4/U5      u  nXu:  =(       d    Xv:  nU R	                  SS9n	[
        R                  " X#/X/4SU	0UD6n
U R                  U
5        [        R                  R                  U
R                  5       l        U(       a  U R                  S5        U
$ )a'  
Add a horizontal line spanning the whole or fraction of the Axes.

Note: If you want to set x-limits in data coordinates, use
`~.Axes.hlines` instead.

Parameters
----------
y : float, default: 0
    y position in :ref:`data coordinates <coordinate-systems>`.

xmin : float, default: 0
    The start x-position in :ref:`axes coordinates <coordinate-systems>`.
    Should be between 0 and 1, 0 being the far left of the plot,
    1 the far right of the plot.

xmax : float, default: 1
    The end x-position in :ref:`axes coordinates <coordinate-systems>`.
    Should be between 0 and 1, 0 being the far left of the plot,
    1 the far right of the plot.

Returns
-------
`~matplotlib.lines.Line2D`
    A `.Line2D` specified via two points ``(xmin, y)``, ``(xmax, y)``.
    Its transform is set such that *x* is in
    :ref:`axes coordinates <coordinate-systems>` and *y* is in
    :ref:`data coordinates <coordinate-systems>`.

    This is still a generic line and the horizontal character is only
    realized through using identical *y* values for both points. Thus,
    if you want to change the *y* value later, you have to provide two
    values ``line.set_ydata([3, 3])``.

Other Parameters
----------------
**kwargs
    Valid keyword arguments are `.Line2D` properties, except for
    'transform':

    %(Line2D:kwdoc)s

See Also
--------
hlines : Add horizontal lines in data coordinates.
axhspan : Add a horizontal span (rectangle) across the axis.
axline : Add a line with an arbitrary slope.

Examples
--------
* draw a thick red hline at 'y' = 0 that spans the xrange::

    >>> axhline(linewidth=4, color='r')

* draw a default hline at 'y' = 1 that spans the xrange::

    >>> axhline(y=1)

* draw a default hline at 'y' = .5 that spans the middle half of
  the xrange::

    >>> axhline(y=.5, xmin=0.25, xmax=0.75)
xminxmaxr]   zV'transform' is not allowed as a keyword argument; axhline generates its own transform.r,   gridwhich)_check_no_unitsr   
get_ybound_process_unit_infoget_yaxis_transformmlinesLine2Dadd_liner6   axisGRIDLINE_INTERPOLATION_STEPSget_path_interpolation_steps_request_autoscale_view)r(   r,   r   r   rC   yminymaxyyscaleytransls              r   axhlineAxes.axhline  s    B 	d\FF+;<&  N O O__&
 %%Qxj&9)+((v(6MM4,J%J6Ja,/HH,Q,Q

)((-r   c                    U R                  X#/SS/5        SU;   a  [        S5      eU R                  5       u  pVU R                  SU4/U5      u  nXu:  =(       d    Xv:  nU R	                  SS9n	[
        R                  " X/X#/4SU	0UD6n
U R                  U
5        [        R                  R                  U
R                  5       l        U(       a  U R                  S5        U
$ )a  
Add a vertical line spanning the whole or fraction of the Axes.

Note: If you want to set y-limits in data coordinates, use
`~.Axes.vlines` instead.

Parameters
----------
x : float, default: 0
    x position in :ref:`data coordinates <coordinate-systems>`.

ymin : float, default: 0
    The start y-position in :ref:`axes coordinates <coordinate-systems>`.
    Should be between 0 and 1, 0 being the bottom of the plot, 1 the
    top of the plot.

ymax : float, default: 1
    The end y-position in :ref:`axes coordinates <coordinate-systems>`.
    Should be between 0 and 1, 0 being the bottom of the plot, 1 the
    top of the plot.

Returns
-------
`~matplotlib.lines.Line2D`
    A `.Line2D` specified via two points ``(x, ymin)``, ``(x, ymax)``.
    Its transform is set such that *x* is in
    :ref:`data coordinates <coordinate-systems>` and *y* is in
    :ref:`axes coordinates <coordinate-systems>`.

    This is still a generic line and the vertical character is only
    realized through using identical *x* values for both points. Thus,
    if you want to change the *x* value later, you have to provide two
    values ``line.set_xdata([3, 3])``.

Other Parameters
----------------
**kwargs
    Valid keyword arguments are `.Line2D` properties, except for
    'transform':

    %(Line2D:kwdoc)s

See Also
--------
vlines : Add vertical lines in data coordinates.
axvspan : Add a vertical span (rectangle) across the axis.
axline : Add a line with an arbitrary slope.

Examples
--------
* draw a thick red vline at *x* = 0 that spans the yrange::

    >>> axvline(linewidth=4, color='r')

* draw a default vline at *x* = 1 that spans the yrange::

    >>> axvline(x=1)

* draw a default vline at *x* = .5 that spans the middle half of
  the yrange::

    >>> axvline(x=.5, ymin=0.25, ymax=0.75)
r   r   r]   zV'transform' is not allowed as a keyword argument; axvline generates its own transform.r   r   r   )r   r   
get_xboundr   get_xaxis_transformr   r   r   r6   r   r   r   r   r   )r(   r   r   r   rC   r   r   xxscalexr   r   s              r   axvlineAxes.axvline/  s    B 	d\FF+;<&  N O O__&
 %%Qxj&9)+((v(6MM1&4,J%J6Ja,/HH,Q,Q

)((-r   c                     [        X5       H0  u  p#[        R                  " U5      (       a  M"  [        U SU 35      e   g )Nz( must be a single scalar value, but got )zipmunits_is_natively_supportedr   )valsnamesvalnames       r   r   Axes._check_no_units  sF     T)IC0055 D6 *,,/5"2 3 3 *r   )slopec                d   Ub3  U R                  5       S:w  d  U R                  5       S:w  a  [        S5      eUc  U/OX/nSU;   a  / n[        R                  " XU40 UD6nU R                  U5        UR                  5       c  UR                  U R                  5        UR                  5       (       d'  UR                  S[        U R                  5       35        U R                  R                  U5        U R                  R                  Ul        U R!                  U5        U R#                  5         U$ )a4  
Add an infinitely long straight line.

The line can be defined either by two points *xy1* and *xy2*, or
by one point *xy1* and a *slope*.

This draws a straight line "on the screen", regardless of the x and y
scales, and is thus also suitable for drawing exponential decays in
semilog plots, power laws in loglog plots, etc. However, *slope*
should only be used with linear scales; It has no clear meaning for
all other scales, and thus the behavior is undefined. Please specify
the line using the points *xy1*, *xy2* for non-linear scales.

The *transform* keyword argument only applies to the points *xy1*,
*xy2*. The *slope* (if given) is always in data coordinates. This can
be used e.g. with ``ax.transAxes`` for drawing grid lines with a fixed
slope.

Parameters
----------
xy1, xy2 : (float, float)
    Points for the line to pass through.
    Either *xy2* or *slope* has to be given.
slope : float, optional
    The slope of the line. Either *xy2* or *slope* has to be given.

Returns
-------
`.AxLine`

Other Parameters
----------------
**kwargs
    Valid kwargs are `.Line2D` properties

    %(Line2D:kwdoc)s

See Also
--------
axhline : for horizontal lines
axvline : for vertical lines

Examples
--------
Draw a thick red line passing through (0, 0) and (1, 1)::

    >>> axline((0, 0), (1, 1), linewidth=4, color='r')
linearz-'slope' cannot be used with non-linear scalesr]   _child)
get_xscale
get_yscale	TypeErrorr   AxLine_set_artist_propsr   r   r   	get_label	set_labellen	_childrenappendremoverU   update_datalimr   )r(   xy1xy2r   rC   datalimlines          r   axlineAxes.axline  s   d $//"3x"?"&//"3x"?KLL;3%SJ&  G}}Su77t$'tzz*~~NNVC$7#89:d#"nn33G$$$&r   c                 .   U R                  X4/SS/5        U R                  SX/4/U5      u  u  p[        R                  " X14XC-
  X!-
  40 UD6nUR	                  U R                  SS95        U R                  R                  R                  5       nU R                  R                  nU R                  U5        XpR                  l        XR                  l	        [        R                  R                  UR                  5       l        U R!                  S5        U$ )a  
Add a horizontal span (rectangle) across the Axes.

The rectangle spans from *ymin* to *ymax* vertically, and, by default,
the whole x-axis horizontally.  The x-span can be set using *xmin*
(default: 0) and *xmax* (default: 1) which are in axis units; e.g.
``xmin = 0.5`` always refers to the middle of the x-axis regardless of
the limits set by `~.Axes.set_xlim`.

Parameters
----------
ymin : float
    Lower y-coordinate of the span, in data units.
ymax : float
    Upper y-coordinate of the span, in data units.
xmin : float, default: 0
    Lower x-coordinate of the span, in x-axis (0-1) units.
xmax : float, default: 1
    Upper x-coordinate of the span, in x-axis (0-1) units.

Returns
-------
`~matplotlib.patches.Rectangle`
    Horizontal span (rectangle) from (xmin, ymin) to (xmax, ymax).

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

%(Rectangle:kwdoc)s

See Also
--------
axvspan : Add a vertical span across the Axes.
r   r   r,   r   r   )r   r   mpatches	Rectangler   r   dataLim	intervalxcopyminposx	add_patchr6   r   r   r   r   r   )	r(   r   r   r   r   rC   pixmxs	            r   axhspanAxes.axhspan  s    L 	d\FF+;<//#|1D0EvN|T[$+PP	00v0>? \\##((*\\!!q!#!,/HH,Q,Q

)$$S)r   c                 .   U R                  X4/SS/5        U R                  SX/4/U5      u  u  p[        R                  " X4X!-
  XC-
  40 UD6nUR	                  U R                  SS95        U R                  R                  R                  5       nU R                  R                  nU R                  U5        XpR                  l        XR                  l	        [        R                  R                  UR                  5       l        U R!                  S5        U$ )a  
Add a vertical span (rectangle) across the Axes.

The rectangle spans from *xmin* to *xmax* horizontally, and, by
default, the whole y-axis vertically.  The y-span can be set using
*ymin* (default: 0) and *ymax* (default: 1) which are in axis units;
e.g. ``ymin = 0.5`` always refers to the middle of the y-axis
regardless of the limits set by `~.Axes.set_ylim`.

Parameters
----------
xmin : float
    Lower x-coordinate of the span, in data units.
xmax : float
    Upper x-coordinate of the span, in data units.
ymin : float, default: 0
    Lower y-coordinate of the span, in y-axis units (0-1).
ymax : float, default: 1
    Upper y-coordinate of the span, in y-axis units (0-1).

Returns
-------
`~matplotlib.patches.Rectangle`
    Vertical span (rectangle) from (xmin, ymin) to (xmax, ymax).

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

%(Rectangle:kwdoc)s

See Also
--------
axhspan : Add a horizontal span across the Axes.

Examples
--------
Draw a vertical, green, translucent rectangle from x = 1.25 to
x = 1.55 that spans the yrange of the Axes.

>>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)

r   r   r   r   r   )r   r   r   r   r   r   r   	intervalyr   minposyr   r6   r   r   r   r   r   )	r(   r   r   r   r   rC   r   iymys	            r   axvspanAxes.axvspan  s    \ 	d\FF+;<//#|1D0EvN|T[$+PP	00v0>? \\##((*\\!!q!#!,/HH,Q,Q

)$$S)r   z3.9r@   )r,   r   r   colorsr,   )replace_nameslabel_namerc                    U R                  SU4SU4SU4/U5      u  p#n[        R                  " U5      (       d  U/n[        R                  " U5      (       d  U/n[        R                  " U5      (       d  U/n[        R                  " XU5      u  pn[        R
                  " U5      n[        R
                  " U5      n[        R
                  " U5      n[        R                  R                  [        U5      SS45      nX(SS2SS4'   XSS2SS4'   X8SS2SS4'   XSS2SS4'   [        R                  " XXVS9n	U R                  U	SS	9  U	R                  U5        [        U5      S:  Gak  S
n
S
nU R                  S:X  a  U	R                  U R                  5      nU	R!                  5       nUR#                  U R                  5      u  p[        R$                  " UR&                  5      n[        R(                  " UR*                  5      n[        R$                  " UR,                  5      n[        R(                  " UR.                  5      nOd[        R$                  " US   5      n[        R(                  " US   5      n[        R$                  " US   5      n[        R(                  " US   5      nUU4UU44nU R1                  UX5        U R3                  5         U	$ )a  
Plot horizontal lines at each *y* from *xmin* to *xmax*.

Parameters
----------
y : float or array-like
    y-indexes where to plot the lines.

xmin, xmax : float or array-like
    Respective beginning and end of each line. If scalars are
    provided, all lines will have the same length.

colors : :mpltype:`color` or list of color , default: :rc:`lines.color`

linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, default: 'solid'

label : str, default: ''

Returns
-------
`~matplotlib.collections.LineCollection`

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER
**kwargs :  `~matplotlib.collections.LineCollection` properties.

See Also
--------
vlines : vertical lines
axhline : horizontal line across the Axes
r   r,      Nr      r  
linestylesr@   FautolimTrectilinear.r   .r  r   npiterabler9   _combine_masksravelmaemptyr   mcollLineCollectionadd_collectionr?   r   get_datalimrx   get_transformcontains_branch_seperatelynanminr   nanmaxr   r   r   r   r   )r(   r,   r   r   r  r	  r@   rC   masked_vertslinesupdatexupdateyr   r   minxmaxxminymaxycornerss                      r   hlinesAxes.hlinesJ  s`   P //4[3+Qx0&:A {{1~~A{{4  6D{{4  6D ,,Qd;HHQKxx~xx~uu{{CFAq>2 $Q1W !Q1W $Q1W !Q1W$$\0:IE51v&q6A: GGyyM)++DNN;'')#$#?#?#O yy.yy.yy.yy.yyf!56yyf!56yyf!56yyf!56TlT4L0G:((*r   )r   r   r   r  r   c                    U R                  SU4SU4SU4/U5      u  pn[        R                  " U5      (       d  U/n[        R                  " U5      (       d  U/n[        R                  " U5      (       d  U/n[        R                  " XU5      u  pn[        R
                  " U5      n[        R
                  " U5      n[        R
                  " U5      n[        R                  R                  [        U5      SS45      nXSS2SS4'   X(SS2SS4'   XSS2SS4'   X8SS2SS4'   [        R                  " XXVS9n	U R                  U	SS	9  U	R                  U5        [        U5      S:  Gak  S
n
S
nU R                  S:X  a  U	R                  U R                  5      nU	R!                  5       nUR#                  U R                  5      u  p[        R$                  " UR&                  5      n[        R(                  " UR*                  5      n[        R$                  " UR,                  5      n[        R(                  " UR.                  5      nOd[        R$                  " US   5      n[        R(                  " US   5      n[        R$                  " US   5      n[        R(                  " US   5      nUU4UU44nU R1                  UX5        U R3                  5         U	$ )a  
Plot vertical lines at each *x* from *ymin* to *ymax*.

Parameters
----------
x : float or array-like
    x-indexes where to plot the lines.

ymin, ymax : float or array-like
    Respective beginning and end of each line. If scalars are
    provided, all lines will have the same length.

colors : :mpltype:`color` or list of color, default: :rc:`lines.color`

linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, default: 'solid'

label : str, default: ''

Returns
-------
`~matplotlib.collections.LineCollection`

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER
**kwargs : `~matplotlib.collections.LineCollection` properties.

See Also
--------
hlines : horizontal lines
axvline : vertical line across the Axes
r   r,   r  Nr   r  r  Fr
  Tr  r  r  r  )r(   r   r   r   r  r	  r@   rC   r  r  r   r!  r   r   r"  r#  r$  r%  r&  s                      r   vlinesAxes.vlines  s`   P //1XT{S$K0&: {{1~~A{{4  6D{{4  6D ,,Qd;HHQKxx~xx~uu{{CFAq>2 !Q1W $Q1W !Q1W $Q1W$$\0:IE51v&q6A: GGyyM)++DNN;'')#$#?#?#O yy.yy.yy.yy.yyf!56yyf!56yyf!56yyf!56TlT4L0G:((*r   orientation)	positionslineoffsetslinelengths
linewidthsr  r	  )r  
horizontalc	                 D   U R                  SU4SU4/U	5      u  p4[        R                  " U5      (       d  U/nOU[        S U 5       5      (       a'  U V
s/ s H  n
[        R                  " U
5      PM     nn
O[        R                  " U5      /n/ nU H  n
XR                  SU
4/U	5      -  nM     Un[
        R                  " XiS5      n[
        R                  " XYS5      n[
        R                  " XS5      n[        R                  " U5      (       d  U/n[        R                  " U5      (       d  U/n[        R                  " U5      (       d  U/n[        R                  " U5      (       d  U/n[        R                  " U5      (       d  U/n[        US5      (       d  [        R                  " U5      (       d  U/n[        R                  " U5      n[        R                  " U5      n[        R                  " U5      n[        U5      S:X  a  [        S	5      e[        U5      S:X  a  [        S
5      e[        U5      S:X  a  [        S5      e[        U5      S:X  a  [        S5      e[        U5      S:X  a  [        S5      e[        U5      S:X  a  S/n [        R                  " U5      n[        U5      S:X  aJ  [        U5      S:w  a;  [        R                  " U[        U5      5      nSUS'   [        R                  " U5      n[        U5      S:X  a   [        R                  " U[        U5      5      n[        U5      S:X  a   [        R                  " U[        U5      5      n[        U5      S:X  a  [        U5      [        U5      -  n[        U5      S:X  a  [        U5      [        U5      -  n[        U5      S:X  a  U/[        U5      -  n[        U5      [        U5      :w  a  [        S5      e[        U5      [        U5      :w  a  [        S5      e[        U5      [        U5      :w  a  [        S5      e[        U5      [        U5      :w  a  [        S5      e[        U5      [        U5      :w  a  [        S5      e[        U5      [        U5      :w  a  [        S5      e/ n[!        XXEXgU5       HV  u  ppnnn["        R$                  " U
UUUUUUUS9nU R'                  USS9  UR)                  U	5        UR+                  U5        MX     [        U5      S:  a  U Vs/ s H@  n[        U5      S:  d  M  [        R,                  " U5      [        R.                  " U5      4PMB     nn[        U5      S:  a  [!        U6 u  nn[        R,                  " U5      n[        R.                  " U5      nX4-
  R-                  5       nX4-   R/                  5       nUS:X  a	  UU4UU44nOUU4UU44nU R1                  U5        U R3                  5         U$ s  sn
f ! [         a     GNof = fs  snf )a  
Plot identical parallel lines at the given positions.

This type of plot is commonly used in neuroscience for representing
neural events, where it is usually called a spike raster, dot raster,
or raster plot.

However, it is useful in any situation where you wish to show the
timing or position of multiple sets of discrete events, such as the
arrival times of people to a business on each day of the month or the
date of hurricanes each year of the last century.

Parameters
----------
positions : array-like or list of array-like
    A 1D array-like defines the positions of one sequence of events.

    Multiple groups of events may be passed as a list of array-likes.
    Each group can be styled independently by passing lists of values
    to *lineoffsets*, *linelengths*, *linewidths*, *colors* and
    *linestyles*.

    Note that *positions* can be a 2D array, but in practice different
    event groups usually have different counts so that one will use a
    list of different-length arrays rather than a 2D array.

orientation : {'horizontal', 'vertical'}, default: 'horizontal'
    The direction of the event sequence:

    - 'horizontal': the events are arranged horizontally.
      The indicator lines are vertical.
    - 'vertical': the events are arranged vertically.
      The indicator lines are horizontal.

lineoffsets : float or array-like, default: 1
    The offset of the center of the lines from the origin, in the
    direction orthogonal to *orientation*.

    If *positions* is 2D, this can be a sequence with length matching
    the length of *positions*.

linelengths : float or array-like, default: 1
    The total height of the lines (i.e. the lines stretches from
    ``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).

    If *positions* is 2D, this can be a sequence with length matching
    the length of *positions*.

linewidths : float or array-like, default: :rc:`lines.linewidth`
    The line width(s) of the event lines, in points.

    If *positions* is 2D, this can be a sequence with length matching
    the length of *positions*.

colors : :mpltype:`color` or list of color, default: :rc:`lines.color`
    The color(s) of the event lines.

    If *positions* is 2D, this can be a sequence with length matching
    the length of *positions*.

alpha : float or array-like, default: 1
    The alpha blending value(s), between 0 (transparent) and 1
    (opaque).

    If *positions* is 2D, this can be a sequence with length matching
    the length of *positions*.

linestyles : str or tuple or list of such values, default: 'solid'
    Default is 'solid'. Valid strings are ['solid', 'dashed',
    'dashdot', 'dotted', '-', '--', '-.', ':']. Dash tuples
    should be of the form::

        (offset, onoffseq),

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

    If *positions* is 2D, this can be a sequence with length matching
    the length of *positions*.

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Other keyword arguments are line collection properties.  See
    `.LineCollection` for a list of the valid properties.

Returns
-------
list of `.EventCollection`
    The `.EventCollection` that were added.

Notes
-----
For *linelengths*, *linewidths*, *colors*, *alpha* and *linestyles*, if
only a single value is given, that value is applied to all lines. If an
array-like is given, it must have the same length as *positions*, and
each value will be applied to the corresponding row of the array.

Examples
--------
.. plot:: gallery/lines_bars_and_markers/eventplot_demo.py
r,   c              3   N   #    U  H  n[         R                  " U5      v   M     g 7frZ   )r  r  ).0positions     r   	<genexpr>!Axes.eventplot.<locals>.<genexpr>x  s     Ay8X&&ys   #%r   r5   	linewidth	linestyler&   r   zlineoffsets cannot be emptyzlinelengths cannot be emptyzlinestyles cannot be emptyzlinewidths cannot be emptyzalpha cannot be emptyNr  z5lineoffsets and positions are unequal sized sequencesz5linelengths and positions are unequal sized sequencesz4linewidths and positions are unequal sized sequencesz0colors and positions are unequal sized sequencesz/alpha and positions are unequal sized sequencesz4linestyles and positions are unequal sized sequences)r,  
lineoffset
linelengthr8  r5   rt   r9  Fr
  vertical)r   r  r  any
asanyarrayr9   _local_over_kwdicthasattrasarrayr   r   mcolorsto_rgba_arraytilecumsumlistr   r  EventCollectionr  r?   r   minmaxr   r   )r(   r-  r,  r.  r/  r0  r  rt   r	  rC   r5  posscollsr:  r;  r8  r5   alpha_r9  coll_pmin_maxminsmaxesminposmaxposminlinemaxliner&  s                                r   	eventplotAxes.eventplot  s   ` $(#:#:{#c;%78&$B  {{9%%"IAyAAAAJKXx0IKIy12I!H++c8_,=vFFD "	 ))&'B--j+N
--j+N
{{;''&-K{{;''&-K{{:&&$J{{6""XF{{5!!GE:w''r{{:/F/F$Jjj-jj-ZZ
+
{q :;;{q :;;z?a9::z?a9::u:?455v;!VF	 **62F {q S^q%8''+s9~>KKN))K0K{q ''+s9~>Kz?aS^<Jv;!&\C	N2Fu:?K#i.0Ez?a$I6J{s9~- ) * *{s9~- ) * *z?c)n, ) * *v;#i.( ) * *u:Y' ) * *z?c)n, ) * *  IK:/H* ((5@4>4>3</4/53<>D e4!!&)LL/ y>A:C ')Bb'A+ 0r
BFF2J/)G ' 7|a!7me&499;&499;*,&/'61BBG%w/&'1BBG##G,,,.{ L`  	 		v's$    XX X10X
XXT)r   r   datac                   [         R                  " U[        R                  5      n/ U R                  " U /UQ7SU0UD6QnU H  nU R                  U5        M     U(       a  U R                  S5        U(       a  U R                  S5        U$ )a  
Plot y versus x as lines and/or markers.

Call signatures::

    plot([x], y, [fmt], *, data=None, **kwargs)
    plot([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)

The coordinates of the points or line nodes are given by *x*, *y*.

The optional parameter *fmt* is a convenient way for defining basic
formatting like color, marker and linestyle. It's a shortcut string
notation described in the *Notes* section below.

>>> plot(x, y)        # plot x and y using default line style and color
>>> plot(x, y, 'bo')  # plot x and y using blue circle markers
>>> plot(y)           # plot y using x as index array 0..N-1
>>> plot(y, 'r+')     # ditto, but with red plusses

You can use `.Line2D` properties as keyword arguments for more
control on the appearance. Line properties and *fmt* can be mixed.
The following two calls yield identical results:

>>> plot(x, y, 'go--', linewidth=2, markersize=12)
>>> plot(x, y, color='green', marker='o', linestyle='dashed',
...      linewidth=2, markersize=12)

When conflicting with *fmt*, keyword arguments take precedence.


**Plotting labelled data**

There's a convenient way for plotting objects with labelled data (i.e.
data that can be accessed by index ``obj['y']``). Instead of giving
the data in *x* and *y*, you can provide the object in the *data*
parameter and just give the labels for *x* and *y*::

>>> plot('xlabel', 'ylabel', data=obj)

All indexable objects are supported. This could e.g. be a `dict`, a
`pandas.DataFrame` or a structured numpy array.


**Plotting multiple sets of data**

There are various ways to plot multiple sets of data.

- The most straight forward way is just to call `plot` multiple times.
  Example:

  >>> plot(x1, y1, 'bo')
  >>> plot(x2, y2, 'go')

- If *x* and/or *y* are 2D arrays, a separate data set will be drawn
  for every column. If both *x* and *y* are 2D, they must have the
  same shape. If only one of them is 2D with shape (N, m) the other
  must have length N and will be used for every data set m.

  Example:

  >>> x = [1, 2, 3]
  >>> y = np.array([[1, 2], [3, 4], [5, 6]])
  >>> plot(x, y)

  is equivalent to:

  >>> for col in range(y.shape[1]):
  ...     plot(x, y[:, col])

- The third way is to specify multiple sets of *[x]*, *y*, *[fmt]*
  groups::

  >>> plot(x1, y1, 'g^', x2, y2, 'g-')

  In this case, any additional keyword argument applies to all
  datasets. Also, this syntax cannot be combined with the *data*
  parameter.

By default, each line is assigned a different style specified by a
'style cycle'. The *fmt* and line property parameters are only
necessary if you want explicit deviations from these defaults.
Alternatively, you can also change the style cycle using
:rc:`axes.prop_cycle`.


Parameters
----------
x, y : array-like or float
    The horizontal / vertical coordinates of the data points.
    *x* values are optional and default to ``range(len(y))``.

    Commonly, these parameters are 1D arrays.

    They can also be scalars, or two-dimensional (in that case, the
    columns represent separate data sets).

    These arguments cannot be passed as keywords.

fmt : str, optional
    A format string, e.g. 'ro' for red circles. See the *Notes*
    section for a full description of the format strings.

    Format strings are just an abbreviation for quickly setting
    basic line properties. All of these and more can also be
    controlled by keyword arguments.

    This argument cannot be passed as keyword.

data : indexable object, optional
    An object with labelled data. If given, provide the label names to
    plot in *x* and *y*.

    .. note::
        Technically there's a slight ambiguity in calls where the
        second label is a valid *fmt*. ``plot('n', 'o', data=obj)``
        could be ``plt(x, y)`` or ``plt(y, fmt)``. In such cases,
        the former interpretation is chosen, but a warning is issued.
        You may suppress the warning by adding an empty format string
        ``plot('n', 'o', '', data=obj)``.

Returns
-------
list of `.Line2D`
    A list of lines representing the plotted data.

Other Parameters
----------------
scalex, scaley : bool, default: True
    These parameters determine if the view limits are adapted to the
    data limits. The values are passed on to
    `~.axes.Axes.autoscale_view`.

**kwargs : `~matplotlib.lines.Line2D` properties, optional
    *kwargs* are used to specify properties like a line label (for
    auto legends), linewidth, antialiasing, marker face color.
    Example::

    >>> plot([1, 2, 3], [1, 2, 3], 'go-', label='line 1', linewidth=2)
    >>> plot([1, 2, 3], [1, 4, 9], 'rs', label='line 2')

    If you specify multiple lines with one plot call, the kwargs apply
    to all those lines. In case the label object is iterable, each
    element is used as labels for each set of data.

    Here is a list of available `.Line2D` properties:

    %(Line2D:kwdoc)s

See Also
--------
scatter : XY scatter plot with markers of varying size and/or color (
    sometimes also called bubble chart).

Notes
-----
**Format Strings**

A format string consists of a part for color, marker and line::

    fmt = '[marker][line][color]'

Each of them is optional. If not provided, the value from the style
cycle is used. Exception: If ``line`` is given, but no ``marker``,
the data will be a line without markers.

Other combinations such as ``[color][marker][line]`` are also
supported, but note that their parsing may be ambiguous.

**Markers**

=============   ===============================
character       description
=============   ===============================
``'.'``         point marker
``','``         pixel marker
``'o'``         circle marker
``'v'``         triangle_down marker
``'^'``         triangle_up marker
``'<'``         triangle_left marker
``'>'``         triangle_right marker
``'1'``         tri_down marker
``'2'``         tri_up marker
``'3'``         tri_left marker
``'4'``         tri_right marker
``'8'``         octagon marker
``'s'``         square marker
``'p'``         pentagon marker
``'P'``         plus (filled) marker
``'*'``         star marker
``'h'``         hexagon1 marker
``'H'``         hexagon2 marker
``'+'``         plus marker
``'x'``         x marker
``'X'``         x (filled) marker
``'D'``         diamond marker
``'d'``         thin_diamond marker
``'|'``         vline marker
``'_'``         hline marker
=============   ===============================

**Line Styles**

=============    ===============================
character        description
=============    ===============================
``'-'``          solid line style
``'--'``         dashed line style
``'-.'``         dash-dot line style
``':'``          dotted line style
=============    ===============================

Example format strings::

    'b'    # blue markers with default shape
    'or'   # red circles
    '-g'   # green solid line
    '--'   # dashed line with default color
    '^k:'  # black triangle_up markers connected by a dotted line

**Colors**

The supported color abbreviations are the single letter codes

=============    ===============================
character        color
=============    ===============================
``'b'``          blue
``'g'``          green
``'r'``          red
``'c'``          cyan
``'m'``          magenta
``'y'``          yellow
``'k'``          black
``'w'``          white
=============    ===============================

and the ``'CN'`` colors that index into the default property cycle.

If the color is the only part of the format string, you can
additionally use any  `matplotlib.colors` spec, e.g. full names
(``'green'``) or hex strings (``'#008000'``).
rX  r   r,   )r9   normalize_kwargsr   r   
_get_linesr   r   )r(   r   r   rX  rV   rC   r  r   s           r   plot	Axes.plot  sz    h ''>D$//$CCDCFCDDMM$ ((-((-r   r\  )alternativeFc                     U(       a  U R                  U5        U(       a  U R                  U5        U R                  " XU40 UD6$ )a  
Plot coercing the axis to treat floats as dates.

.. deprecated:: 3.9

    This method exists for historic reasons and will be removed in version 3.11.

    - ``datetime``-like data should directly be plotted using
      `~.Axes.plot`.
    -  If you need to plot plain numeric data as :ref:`date-format` or
       need to set a timezone, call ``ax.xaxis.axis_date`` /
       ``ax.yaxis.axis_date`` before `~.Axes.plot`. See
       `.Axis.axis_date`.

Similar to `.plot`, this plots *y* vs. *x* as lines or markers.
However, the axis labels are formatted as dates depending on *xdate*
and *ydate*.  Note that `.plot` will work with `datetime` and
`numpy.datetime64` objects without resorting to this method.

Parameters
----------
x, y : array-like
    The coordinates of the data points. If *xdate* or *ydate* is
    *True*, the respective values *x* or *y* are interpreted as
    :ref:`Matplotlib dates <date-format>`.

fmt : str, optional
    The plot format string. For details, see the corresponding
    parameter in `.plot`.

tz : timezone string or `datetime.tzinfo`, default: :rc:`timezone`
    The time zone to use in labeling dates.

xdate : bool, default: True
    If *True*, the *x*-axis will be interpreted as Matplotlib dates.

ydate : bool, default: False
    If *True*, the *y*-axis will be interpreted as Matplotlib dates.

Returns
-------
list of `.Line2D`
    Objects representing the plotted data.

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER
**kwargs
    Keyword arguments control the `.Line2D` properties:

    %(Line2D:kwdoc)s

See Also
--------
matplotlib.dates : Helper functions on dates.
matplotlib.dates.date2num : Convert dates to num.
matplotlib.dates.num2date : Convert num to dates.
matplotlib.dates.drange : Create an equally spaced sequence of dates.

Notes
-----
If you are using custom date tickers and formatters, it may be
necessary to set the formatters/locators after the call to
`.plot_date`. `.plot_date` will set the default tick locator to
`.AutoDateLocator` (if the tick locator is not already set to a
`.DateLocator` instance) and the default tick formatter to
`.AutoDateFormatter` (if the tick formatter is not already set to a
`.DateFormatter` instance).
)
xaxis_date
yaxis_dater\  )r(   r   r,   fmttzxdateydaterC   s           r   	plot_dateAxes.plot_date  s9    V OOBOOByys-f--r   c                    UR                  5        VVs0 s H  u  p4US;   d  M  X4_M     nnnU R                  " S0 UD6  UR                  5        VVs0 s H  u  p4US;   d  M  X4_M     nnnU R                  " S0 UD6  U R                  " U0 UR                  5        VVs0 s H  u  p4U1 UkUk;  d  M  X4_M     snnD6$ s  snnf s  snnf s  snnf )a  
Make a plot with log scaling on both the x- and y-axis.

Call signatures::

    loglog([x], y, [fmt], data=None, **kwargs)
    loglog([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)

This is just a thin wrapper around `.plot` which additionally changes
both the x-axis and the y-axis to log scaling. All the concepts and
parameters of plot can be used here as well.

The additional parameters *base*, *subs* and *nonpositive* control the
x/y-axis properties. They are just forwarded to `.Axes.set_xscale` and
`.Axes.set_yscale`. To use different properties on the x-axis and the
y-axis, use e.g.
``ax.set_xscale("log", base=10); ax.set_yscale("log", base=2)``.

Parameters
----------
base : float, default: 10
    Base of the logarithm.

subs : sequence, optional
    The location of the minor ticks. If *None*, reasonable locations
    are automatically chosen depending on the number of decades in the
    plot. See `.Axes.set_xscale`/`.Axes.set_yscale` for details.

nonpositive : {'mask', 'clip'}, default: 'clip'
    Non-positive values can be masked as invalid, or clipped to a very
    small positive number.

**kwargs
    All parameters supported by `.plot`.

Returns
-------
list of `.Line2D`
    Objects representing the plotted data.
basesubsnonpositivebasexsubsxnonposxrj  rk  rl  baseysubsynonposylog)items
set_xscale
set_yscaler\  )r(   rV   rC   kvdxdys          r   loglogAxes.loglogL  s    T  &||~ 5~tq 4 4 ad~ 5 	$$%||~ 5~tq 4 4 ad~ 5 	$$yyO'-||~M~tq*B**9Ldad~MO 	O55
 Ns"   B>B>C"CC
2C
c           
         UR                  5        VVs0 s H  u  p4US;   d  M  X4_M     nnnU R                  " S0 UD6  U R                  " U0 UR                  5        VVs0 s H  u  p4X5;  d  M  X4_M     snnD6$ s  snnf s  snnf )a  
Make a plot with log scaling on the x-axis.

Call signatures::

    semilogx([x], y, [fmt], data=None, **kwargs)
    semilogx([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)

This is just a thin wrapper around `.plot` which additionally changes
the x-axis to log scaling. All the concepts and parameters of plot can
be used here as well.

The additional parameters *base*, *subs*, and *nonpositive* control the
x-axis properties. They are just forwarded to `.Axes.set_xscale`.

Parameters
----------
base : float, default: 10
    Base of the x logarithm.

subs : array-like, optional
    The location of the minor xticks. If *None*, reasonable locations
    are automatically chosen depending on the number of decades in the
    plot. See `.Axes.set_xscale` for details.

nonpositive : {'mask', 'clip'}, default: 'clip'
    Non-positive values in x can be masked as invalid, or clipped to a
    very small positive number.

**kwargs
    All parameters supported by `.plot`.

Returns
-------
list of `.Line2D`
    Objects representing the plotted data.
ri  rt  )rv  rw  r\  r(   rV   rC   ry  rz  ds         r   semilogxAxes.semilogx      N %lln 4nda 3 3 QTn 4 	##yyF'-||~D~tqdad~DF 	F	4
 E   A;A; B/Bc           
         UR                  5        VVs0 s H  u  p4US;   d  M  X4_M     nnnU R                  " S0 UD6  U R                  " U0 UR                  5        VVs0 s H  u  p4X5;  d  M  X4_M     snnD6$ s  snnf s  snnf )a  
Make a plot with log scaling on the y-axis.

Call signatures::

    semilogy([x], y, [fmt], data=None, **kwargs)
    semilogy([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)

This is just a thin wrapper around `.plot` which additionally changes
the y-axis to log scaling. All the concepts and parameters of plot can
be used here as well.

The additional parameters *base*, *subs*, and *nonpositive* control the
y-axis properties. They are just forwarded to `.Axes.set_yscale`.

Parameters
----------
base : float, default: 10
    Base of the y logarithm.

subs : array-like, optional
    The location of the minor yticks. If *None*, reasonable locations
    are automatically chosen depending on the number of decades in the
    plot. See `.Axes.set_yscale` for details.

nonpositive : {'mask', 'clip'}, default: 'clip'
    Non-positive values in y can be masked as invalid, or clipped to a
    very small positive number.

**kwargs
    All parameters supported by `.plot`.

Returns
-------
list of `.Line2D`
    Objects representing the plotted data.
rp  rt  )rv  rx  r\  r  s         r   semilogyAxes.semilogy  r  r  c                 (    U R                   " X40 UD6$ )a  
Plot the autocorrelation of *x*.

Parameters
----------
x : array-like
    Not run through Matplotlib's unit conversion, so this should
    be a unit-less array.

detrend : callable, default: `.mlab.detrend_none` (no detrending)
    A detrending function applied to *x*.  It must have the
    signature ::

        detrend(x: np.ndarray) -> np.ndarray

normed : bool, default: True
    If ``True``, input vectors are normalised to unit length.

usevlines : bool, default: True
    Determines the plot style.

    If ``True``, vertical lines are plotted from 0 to the acorr value
    using `.Axes.vlines`. Additionally, a horizontal line is plotted
    at y=0 using `.Axes.axhline`.

    If ``False``, markers are plotted at the acorr values using
    `.Axes.plot`.

maxlags : int, default: 10
    Number of lags to show. If ``None``, will return all
    ``2 * len(x) - 1`` lags.

Returns
-------
lags : array (length ``2*maxlags+1``)
    The lag vector.
c : array  (length ``2*maxlags+1``)
    The auto correlation vector.
line : `.LineCollection` or `.Line2D`
    `.Artist` added to the Axes of the correlation:

    - `.LineCollection` if *usevlines* is True.
    - `.Line2D` if *usevlines* is False.
b : `~matplotlib.lines.Line2D` or None
    Horizontal line at 0 if *usevlines* is True
    None *usevlines* is False.

Other Parameters
----------------
linestyle : `~matplotlib.lines.Line2D` property, optional
    The linestyle for plotting the data points.
    Only used if *usevlines* is ``False``.

marker : str, default: 'o'
    The marker for plotting the data points.
    Only used if *usevlines* is ``False``.

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Additional parameters are passed to `.Axes.vlines` and
    `.Axes.axhline` if *usevlines* is ``True``; otherwise they are
    passed to `.Axes.plot`.

Notes
-----
The cross correlation is performed with `numpy.correlate` with
``mode = "full"``.
)xcorr)r(   r   rC   s      r   acorr
Axes.acorr  s    P zz!)&))r   normed
   c                    [        U5      nU[        U5      :w  a  [        S5      eU" [        R                  " U5      5      nU" [        R                  " U5      5      n[        R                  " XSS9n	U(       aD  U	[        R
                  " [        R                  " X5      [        R                  " X"5      -  5      -  n	Uc  US-
  nXh:  d  US:  a  [        SU-  5      e[        R                  " U* US-   5      n
XS-
  U-
  X-    n	U(       a;  U R                  " U
S/U	40 UD6nUR                  SS	5        U R                  " S0 UD6nO;UR                  S
S5        UR                  SS5        U R                  " X40 UD6u  nSnXX4$ )aX  
Plot the cross correlation between *x* and *y*.

The correlation with lag k is defined as
:math:`\sum_n x[n+k] \cdot y^*[n]`, where :math:`y^*` is the complex
conjugate of :math:`y`.

Parameters
----------
x, y : array-like of length n
    Neither *x* nor *y* are run through Matplotlib's unit conversion, so
    these should be unit-less arrays.

detrend : callable, default: `.mlab.detrend_none` (no detrending)
    A detrending function applied to *x* and *y*.  It must have the
    signature ::

        detrend(x: np.ndarray) -> np.ndarray

normed : bool, default: True
    If ``True``, input vectors are normalised to unit length.

usevlines : bool, default: True
    Determines the plot style.

    If ``True``, vertical lines are plotted from 0 to the xcorr value
    using `.Axes.vlines`. Additionally, a horizontal line is plotted
    at y=0 using `.Axes.axhline`.

    If ``False``, markers are plotted at the xcorr values using
    `.Axes.plot`.

maxlags : int, default: 10
    Number of lags to show. If None, will return all ``2 * len(x) - 1``
    lags.

Returns
-------
lags : array (length ``2*maxlags+1``)
    The lag vector.
c : array  (length ``2*maxlags+1``)
    The auto correlation vector.
line : `.LineCollection` or `.Line2D`
    `.Artist` added to the Axes of the correlation:

    - `.LineCollection` if *usevlines* is True.
    - `.Line2D` if *usevlines* is False.
b : `~matplotlib.lines.Line2D` or None
    Horizontal line at 0 if *usevlines* is True
    None *usevlines* is False.

Other Parameters
----------------
linestyle : `~matplotlib.lines.Line2D` property, optional
    The linestyle for plotting the data points.
    Only used if *usevlines* is ``False``.

marker : str, default: 'o'
    The marker for plotting the data points.
    Only used if *usevlines* is ``False``.

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Additional parameters are passed to `.Axes.vlines` and
    `.Axes.axhline` if *usevlines* is ``True``; otherwise they are
    passed to `.Axes.plot`.

Notes
-----
The cross correlation is performed with `numpy.correlate` with
``mode = "full"``.
zx and y must be equal lengthfull)modeNr  z.maxlags must be None or strictly positive < %dr   r@    markeror9  Nonerb   )r   r   r  rA  	correlatesqrtdotaranger*  popr   rd   r\  )r(   r   r,   r  detrend	usevlinesmaxlagsrC   Nxcorrelslagsr   bs                r   r  
Axes.xcorr)  sd   \ VQ<;<<BJJqM"BJJqM",,q&1qrvva|(C DDG?1fG=GaK -/12 3 3 yy'7Q;/q&7*2<8D1#w9&9AJJw#&v&Ah,k6243F3BAAa""r   pre)whererX  c                l    [         R                  " SUS9  SU-   US'   U R                  " X/UQ7SU0UD6$ )a  
Make a step plot.

Call signatures::

    step(x, y, [fmt], *, data=None, where='pre', **kwargs)
    step(x, y, [fmt], x2, y2, [fmt2], ..., *, where='pre', **kwargs)

This is just a thin wrapper around `.plot` which changes some
formatting options. Most of the concepts and parameters of plot can be
used here as well.

.. note::

    This method uses a standard plot with a step drawstyle: The *x*
    values are the reference positions and steps extend left/right/both
    directions depending on *where*.

    For the common case where you know the values and edges of the
    steps, use `~.Axes.stairs` instead.

Parameters
----------
x : array-like
    1D sequence of x positions. It is assumed, but not checked, that
    it is uniformly increasing.

y : array-like
    1D sequence of y levels.

fmt : str, optional
    A format string, e.g. 'g' for a green line. See `.plot` for a more
    detailed description.

    Note: While full format strings are accepted, it is recommended to
    only specify the color. Line styles are currently ignored (use
    the keyword argument *linestyle* instead). Markers are accepted
    and plotted on the given positions, however, this is a rarely
    needed feature for step plots.

where : {'pre', 'post', 'mid'}, default: 'pre'
    Define where the steps should be placed:

    - 'pre': The y value is continued constantly to the left from
      every *x* position, i.e. the interval ``(x[i-1], x[i]]`` has the
      value ``y[i]``.
    - 'post': The y value is continued constantly to the right from
      every *x* position, i.e. the interval ``[x[i], x[i+1])`` has the
      value ``y[i]``.
    - 'mid': Steps occur half-way between the *x* positions.

data : indexable object, optional
    An object with labelled data. If given, provide the label names to
    plot in *x* and *y*.

**kwargs
    Additional parameters are the same as those for `.plot`.

Returns
-------
list of `.Line2D`
    Objects representing the plotted data.
)r  postmid)r  zsteps-	drawstylerX  )r   check_in_listr\  )r(   r   r,   r  rX  rV   rC   s          r   step	Axes.step  sC    @ 	1?&.{yy::4:6::r   c                 &   [        U5      [        R                  L d   eUR                  S:X  a  U" U 5      $   [        R
                  " U5      n [        R
                  " U5      nSn[        R                  " U 5      (       d  U /n SnU  Vs/ s H  oc" X-   5      U-
  PM     n nU(       a  U S   n U $ ! [        [        [        4 a     Nzf = f! [        [        [        4 a    Un Nf = fs  snf ! [        [        [        4 a    U" U 5      n  U $ f = f)a  
Small helper to do logic of width conversion flexibly.

*dx* and *x0* have units, but *xconv* has already been converted
to unitless (and is an ndarray).  This allows the *dx* to have units
that are different from *x0*, but are still accepted by the
``__add__`` operator of *x0*.
r   FT)typer  ndarraysizer9   _safe_first_finiter   
IndexErrorKeyErrorr  r   AttributeError)r{  x0xconvconvertr   delistddxs          r   _convert_dxAxes._convert_dx  s    E{bjj(((::?2;	--b1,,U3 F;;r??T3562C'"(#a'2B6U
 	' z84 
 z84  7 I~6 	 B			sY   B2 C &&C/ C*"C/ 2C
C/ 	C

C/ C'$C/ &C''C/ /DDc                    UR                  SS5      nUR                  SU5      nUR                  SS5      nUb  UOU R                  R                  5       n [        R                  " U5      nX44$ ! [
         a  n[        S5      UeSnAff = f)a  
Helper function to process color-related arguments of `.Axes.bar`.

Argument precedence for facecolors:

- kwargs['facecolor']
- kwargs['color']
- 'Result of ``self._get_patches_for_fill.get_next_color``

Argument precedence for edgecolors:

- kwargs['edgecolor']
- None

Parameters
----------
self : Axes

kwargs : dict
    Additional kwargs. If these keys exist, we pop and process them:
    'facecolor', 'edgecolor', 'color'
    Note: The dict is modified by this function.


Returns
-------
facecolor
    The facecolor. One or more colors as (N, 4) rgba array.
edgecolor
    The edgecolor. Not normalized; may be any valid color spec or None.
r5   Nrr   rs   zK'facecolor' or 'color' argument must be a valid color orsequence of colors.)r  _get_patches_for_fillget_next_colorrB  rC  r   )r(   rC   r5   rr   rs   errs         r   _parse_bar_color_argsAxes._parse_bar_color_args	  s    @ 

7D)JJ{E2	JJ{D1	"+"7Y44CCE 		--i8I ##  	* 	s   A0 0
B:BBalignc                   [         R                  " U[        R                  5      nU R	                  U5      u  pxUR                  SS5      n	UR                  SS5      n
UR                  SS5      nUR                  SS5      nUR                  SS5      nUc  0 OUR                  5       nUR                  SS5      nUc  UR                  SS5      nUb  US-  nUR                  SU5        UR                  S	S
5      nUR                  S[        R                  S   5      nUR                  S	U5        UR                  SU5        UR                  SS5      n[        R                  " SS/US9  UR                  SS5      nUR                  SS5      nUR                  SS5      nUnUS:X  a  Uc  SnOUc  SnUS:X  a2  U R                  SU4SU4SU4/USS9  U(       a  U R                  SSS9  O1U R                  SU4SU4SU4/USS9  U(       a  U R                  SSS9  U R                   bd  Un["        R$                  " U R'                  U5      5      nU R)                  UUXR&                  5      nUb  U R)                  UUXR&                  5      nU R*                  bf  Un["        R$                  " U R-                  U5      5      nU R)                  UUUU R,                  5      nUb  U R)                  UUUU R,                  5      n["        R.                  " ["        R0                  " U5      X#UX5      u  pnnpUS:X  a  U R                   nUnOU R*                  nUn[3        U[4        5      (       d   ["        R6                  " U5      (       a  SnUnOUnS/[9        U5      -  n[9        U5      [9        U5      :w  a$  [;        S[9        U5       S[9        U5       S35      e[<        R>                  " ["        R0                  " U	5      5      n	[<        R>                  " ["        R0                  " U
5      5      n
[<        R@                  " [<        R>                  " U5      [<        RB                  " S 5      5      nUc  [<        RB                  " S5      nOS[<        R@                  " [<        R>                  " [D        RF                  " U5      5      [<        RB                  " S 5      5      n[        R                  " S!S"/US#9  US!:X  a  US:X  a   XS$-  -
  nUnO UUS$-  -
  nUnOUnUn/ n[M        UXCX'XU
U5	      nU H  u	  n n!n"n#n$nn%n&n'[        RN                  " U U!4U"U#U$UU%U'U&S*9n(U(RQ                  U5        S+U(RS                  5       l*        US:X  a&  U(RV                  RX                  R[                  U!5        O%U(RV                  R\                  R[                  U 5        U R_                  U(5        UR[                  U(5        M     Uc  Ub  US:X  aK  [M        UU5       V V"s/ s H  u  n n"U S,U"-  -   PM     n)n n"[M        XB5       V!V#s/ s H  u  n!n#U!U#-   PM     n*n!n#OJ[M        UU5       V V"s/ s H  u  n n"U U"-   PM     n)n n"[M        XB5       V!V#s/ s H  u  n!n#U!S,U#-  -   PM     n*n!n#UR                  SS5        U R`                  " U)U*4XS S-.UD6n+OSn+U Rc                  5         US:X  a  Un,OUn,[e        UU+U,UUS.9n-U Rg                  U-5        UbB  ["        Rh                  " U[9        U5      5      nURk                  U5        URm                  U5        U-$ ! [H         a,  n[I        S%URJ                   S&URJ                   S'35      UeSnAff = f! [H         a,  n[I        S(URJ                   S)URJ                   S'35      UeSnAff = fs  sn"n f s  sn#n!f s  sn"n f s  sn#n!f )/a\  
Make a bar plot.

The bars are positioned at *x* with the given *align*\ment. Their
dimensions are given by *height* and *width*. The vertical baseline
is *bottom* (default 0).

Many parameters can take either a single value applying to all bars
or a sequence of values, one for each bar.

Parameters
----------
x : float or array-like
    The x coordinates of the bars. See also *align* for the
    alignment of the bars to the coordinates.

    Bars are often used for categorical data, i.e. string labels below
    the bars. You can provide a list of strings directly to *x*.
    ``bar(['A', 'B', 'C'], [1, 2, 3])`` is often a shorter and more
    convenient notation compared to
    ``bar(range(3), [1, 2, 3], tick_label=['A', 'B', 'C'])``. They are
    equivalent as long as the names are unique. The explicit *tick_label*
    notation draws the names in the sequence given. However, when having
    duplicate values in categorical *x* data, these values map to the same
    numerical x coordinate, and hence the corresponding bars are drawn on
    top of each other.

height : float or array-like
    The height(s) of the bars.

    Note that if *bottom* has units (e.g. datetime), *height* should be in
    units that are a difference from the value of *bottom* (e.g. timedelta).

width : float or array-like, default: 0.8
    The width(s) of the bars.

    Note that if *x* has units (e.g. datetime), then *width* should be in
    units that are a difference (e.g. timedelta) around the *x* values.

bottom : float or array-like, default: 0
    The y coordinate(s) of the bottom side(s) of the bars.

    Note that if *bottom* has units, then the y-axis will get a Locator and
    Formatter appropriate for the units (e.g. dates, or categorical).

align : {'center', 'edge'}, default: 'center'
    Alignment of the bars to the *x* coordinates:

    - 'center': Center the base on the *x* positions.
    - 'edge': Align the left edges of the bars with the *x* positions.

    To align the bars on the right edge pass a negative *width* and
    ``align='edge'``.

Returns
-------
`.BarContainer`
    Container with all the bars and optionally errorbars.

Other Parameters
----------------
color : :mpltype:`color` or list of :mpltype:`color`, optional
    The colors of the bar faces. This is an alias for *facecolor*.
    If both are given, *facecolor* takes precedence.

facecolor : :mpltype:`color` or list of :mpltype:`color`, optional
    The colors of the bar faces.
    If both *color* and *facecolor are given, *facecolor* takes precedence.

edgecolor : :mpltype:`color` or list of :mpltype:`color`, optional
    The colors of the bar edges.

linewidth : float or array-like, optional
    Width of the bar edge(s). If 0, don't draw edges.

tick_label : str or list of str, optional
    The tick labels of the bars.
    Default: None (Use default numeric labels.)

label : str or list of str, optional
    A single label is attached to the resulting `.BarContainer` as a
    label for the whole dataset.
    If a list is provided, it must be the same length as *x* and
    labels the individual bars. Repeated labels are not de-duplicated
    and will cause repeated label entries, so this is best used when
    bars also differ in style (e.g., by passing a list to *color*.)

xerr, yerr : float or array-like of shape(N,) or shape(2, N), optional
    If not *None*, add horizontal / vertical errorbars to the bar tips.
    The values are +/- sizes relative to the data:

    - scalar: symmetric +/- values for all bars
    - shape(N,): symmetric +/- values for each bar
    - shape(2, N): Separate - and + values for each bar. First row
      contains the lower errors, the second row contains the upper
      errors.
    - *None*: No errorbar. (Default)

    See :doc:`/gallery/statistics/errorbar_features` for an example on
    the usage of *xerr* and *yerr*.

ecolor : :mpltype:`color` or list of :mpltype:`color`, default: 'black'
    The line color of the errorbars.

capsize : float, default: :rc:`errorbar.capsize`
   The length of the error bar caps in points.

error_kw : dict, optional
    Dictionary of keyword arguments to be passed to the
    `~.Axes.errorbar` method. Values of *ecolor* or *capsize* defined
    here take precedence over the independent keyword arguments.

log : bool, default: False
    If *True*, set the y-axis to be log scale.

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs : `.Rectangle` properties

%(Rectangle:kwdoc)s

See Also
--------
barh : Plot a horizontal bar plot.

Notes
-----
Stacked bars can be achieved by passing individual *bottom* values per
bar. See :doc:`/gallery/lines_bars_and_markers/bar_stacked`.
r8  Nhatchxerryerrerror_kwr^   {Gz?ecolorry  capsizeerrorbar.capsizer,  r<  r1  r,  ru  Fr@   r  
tick_labelr   r   r,   r  cliprl  
_nolegend_znumber of labels (z!) does not match number of bars (z).rp   r   edger  r  zthe dtypes of parameters x (z) and width (z) are incompatiblezthe dtypes of parameters y (z) and height ()r   widthheightrr   rs   r8  r@   r  d   rq   )r  r  rb  )
datavaluesr,  r@   )7r9   rZ  r   Patchr  r  r   r   rd   r6   r7   r   r  r   rx  rw  xaxisr  rA  convert_xunitsr  yaxisconvert_yunitsbroadcast_arrays
atleast_1dr   strr  r   r   	itertoolscyclechainrepeatrB  rC  r   dtyper   r   r?   r   r   sticky_edgesr,   r   r   r   errorbarr   r   add_containerbroadcast_to	set_ticksset_ticklabels).r(   r   r  r  r   r  rC   rr   rs   r8  r  r  r  r  ezorderr  r  r,  ru  r@   tick_labelsr,   r  y0tick_label_axistick_label_positionbar_container_labelpatch_labelsr   epatchesrV   r   r  whclwhtchlblrexeyr  r  bar_containers.                                                 r   barAxes.barF	  s   N ''?#99&A	JJ{D1	

7D) zz&$'zz&$'::j$/!)2x}},,x.?jj40G" 4Hg.Hc***Y5G(HIHf-Iw/
 jj
;J5;Ojj&

7B'jjt4*$yy*$ ##qC8c6]3VU $ L6:
 ##qC<#q2FE $ K6: ::!B

4..q12A$$UB3F3FGE''b!5H5HI::!B

4..q12A%%fb!T5H5HIF''b!T5H5HI020C0CMM!fQ	1B-5!Y
 *$"jjO"#"jjO"#%%%"++e*<*<". L"'(>CF2L|A&1#l2C1D E??B1vhbJ K K OOBMM)$<=	e 45OOIOOI$>$-$4$4V$<>	 !((.I! 5 5i @A  (*I 	Hf-U;Hj(@qy=D
 @!^F
 DF49,(/3+Aq!Q1b$""q61A v&03AJJL-j(  ''*  ''*NN1NN1! 04$ t/j(.1$.>?.>daa#'k.>?(+F(;<(;1a!e(;< ),D%(89(81a!e(89.1&.AB.Adaa#'k.AB6}}R 1$v 1'/1H H$$&*$JJ$Wh:1<+>@ 	=)"//+s7|DK%%&9:**;7S ! @#&B177) L227++ ?7%8 9>?@@ ! @#&B177) L339<<. A7%8 9>?@@B @< :BsH   <\> ]7 ^02^6^<:_>
]4']//]47
^-'^((^-)r  rX  c          
      V    UR                  SS5        U R                  " SXCX!XVS.UD6nU$ )a  
Make a horizontal bar plot.

The bars are positioned at *y* with the given *align*\ment. Their
dimensions are given by *width* and *height*. The horizontal baseline
is *left* (default 0).

Many parameters can take either a single value applying to all bars
or a sequence of values, one for each bar.

Parameters
----------
y : float or array-like
    The y coordinates of the bars. See also *align* for the
    alignment of the bars to the coordinates.

    Bars are often used for categorical data, i.e. string labels below
    the bars. You can provide a list of strings directly to *y*.
    ``barh(['A', 'B', 'C'], [1, 2, 3])`` is often a shorter and more
    convenient notation compared to
    ``barh(range(3), [1, 2, 3], tick_label=['A', 'B', 'C'])``. They are
    equivalent as long as the names are unique. The explicit *tick_label*
    notation draws the names in the sequence given. However, when having
    duplicate values in categorical *y* data, these values map to the same
    numerical y coordinate, and hence the corresponding bars are drawn on
    top of each other.

width : float or array-like
    The width(s) of the bars.

    Note that if *left* has units (e.g. datetime), *width* should be in
    units that are a difference from the value of *left* (e.g. timedelta).

height : float or array-like, default: 0.8
    The heights of the bars.

    Note that if *y* has units (e.g. datetime), then *height* should be in
    units that are a difference (e.g. timedelta) around the *y* values.

left : float or array-like, default: 0
    The x coordinates of the left side(s) of the bars.

    Note that if *left* has units, then the x-axis will get a Locator and
    Formatter appropriate for the units (e.g. dates, or categorical).

align : {'center', 'edge'}, default: 'center'
    Alignment of the base to the *y* coordinates*:

    - 'center': Center the bars on the *y* positions.
    - 'edge': Align the bottom edges of the bars with the *y*
      positions.

    To align the bars on the top edge pass a negative *height* and
    ``align='edge'``.

Returns
-------
`.BarContainer`
    Container with all the bars and optionally errorbars.

Other Parameters
----------------
color : :mpltype:`color` or list of :mpltype:`color`, optional
    The colors of the bar faces.

edgecolor : :mpltype:`color` or list of :mpltype:`color`, optional
    The colors of the bar edges.

linewidth : float or array-like, optional
    Width of the bar edge(s). If 0, don't draw edges.

tick_label : str or list of str, optional
    The tick labels of the bars.
    Default: None (Use default numeric labels.)

label : str or list of str, optional
    A single label is attached to the resulting `.BarContainer` as a
    label for the whole dataset.
    If a list is provided, it must be the same length as *y* and
    labels the individual bars. Repeated labels are not de-duplicated
    and will cause repeated label entries, so this is best used when
    bars also differ in style (e.g., by passing a list to *color*.)

xerr, yerr : float or array-like of shape(N,) or shape(2, N), optional
    If not *None*, add horizontal / vertical errorbars to the bar tips.
    The values are +/- sizes relative to the data:

    - scalar: symmetric +/- values for all bars
    - shape(N,): symmetric +/- values for each bar
    - shape(2, N): Separate - and + values for each bar. First row
      contains the lower errors, the second row contains the upper
      errors.
    - *None*: No errorbar. (default)

    See :doc:`/gallery/statistics/errorbar_features` for an example on
    the usage of *xerr* and *yerr*.

ecolor : :mpltype:`color` or list of :mpltype:`color`, default: 'black'
    The line color of the errorbars.

capsize : float, default: :rc:`errorbar.capsize`
   The length of the error bar caps in points.

error_kw : dict, optional
    Dictionary of keyword arguments to be passed to the
    `~.Axes.errorbar` method. Values of *ecolor* or *capsize* defined
    here take precedence over the independent keyword arguments.

log : bool, default: False
    If ``True``, set the x-axis to be log scale.

data : indexable object, optional
    If given, all parameters also accept a string ``s``, which is
    interpreted as ``data[s]`` if  ``s`` is a key in ``data``.

**kwargs : `.Rectangle` properties

%(Rectangle:kwdoc)s

See Also
--------
bar : Plot a vertical bar plot.

Notes
-----
Stacked bars can be achieved by passing individual *left* values per
bar. See
:doc:`/gallery/lines_bars_and_markers/horizontal_barchart_distribution`.
r,  r1  )r   r  r  r   r  rX  rb   )rd   r  )	r(   r,   r  r  r   r  rX  rC   r  s	            r   barh	Axes.barh
  s<    H 	-6(( =T!&=5;=r   z%gr  )rb  
label_typepaddingc                   S H  nXv;   d  M
  [        SU< S35      e   U R                  R                  5       u  pX:  n
U R                  R                  5       u  pX:  nS n[        R
                  " SS/US9  UR                  nUR                  nUR                  nUR                  nU(       a'  UR                  nUS   nUS	   nUR                  5       nO/ nUc  / n/ n[        R                  " UUUU5       GH  u  nnnnUR                  5       R                  5       u  u  nnu  nnUU-   S-  UU-   S-  n!n US:X  a-  US	:  a  [!        UU5      O[#        UU5      n"[%        UU-
  5      n#O,US	:  a  [!        UU5      O[#        UU5      n"[%        UU-
  5      n#Ub  [&        R(                  " U5      S	:X  a  U"n$OoUS:X  a5  US	:  a  US
S
2S4   R!                  5       OUS
S
2S4   R#                  5       n$O4US	:  a  US
S
2S	4   R!                  5       OUS
S
2S	4   R#                  5       n$US:X  a  U" U5      U#-  n%OU"n%US:X  a  Sn&U4S jUS'   OUS:X  a  U U$4n&OU$U!4n&US:X  a  U
(       a  SOSn'S	U'U" U5      -  U-  4n(OU(       a  SOSn)U)U" U5      -  U-  S	4n(US:X  a  Su  n*n+OCUS:X  a  Sn*U
(       a  US	:  a  SOSn+O)US	:  a  SOSn+OU(       a  US	:  a  SOSn*O
US	:  a  SOSn*Sn+[&        R*                  " U5      (       a  SnUcQ  [-        U[.        5      (       a  [0        R2                  " UU%5      nO$[5        U5      (       a	  U" U%5      nO[7        S5      eU R8                  " UU&U(4SU*U+S.UD6n,UR;                  U,5        GM     U$ )a  
Label a bar plot.

Adds labels to bars in the given `.BarContainer`.
You may need to adjust the axis limits to fit the labels.

Parameters
----------
container : `.BarContainer`
    Container with all the bars and optionally errorbars, likely
    returned from `.bar` or `.barh`.

labels : array-like, optional
    A list of label texts, that should be displayed. If not given, the
    label texts will be the data values formatted with *fmt*.

fmt : str or callable, default: '%g'
    An unnamed %-style or {}-style format string for the label or a
    function to call with the value as the first argument.
    When *fmt* is a string and can be interpreted in both formats,
    %-style takes precedence over {}-style.

    .. versionadded:: 3.7
       Support for {}-style format string and callables.

label_type : {'edge', 'center'}, default: 'edge'
    The label type. Possible values:

    - 'edge': label placed at the end-point of the bar segment, and the
      value displayed will be the position of that end-point.
    - 'center': label placed in the center of the bar segment, and the
      value displayed will be the length of that segment.
      (useful for stacked bars, i.e.,
      :doc:`/gallery/lines_bars_and_markers/bar_label_demo`)

padding : float, default: 0
    Distance of label from the end of the bar, in points.

**kwargs
    Any remaining keyword arguments are passed through to
    `.Axes.annotate`. The alignment parameters (
    *horizontalalignment* / *ha*, *verticalalignment* / *va*) are
    not supported because the labels are automatically aligned to
    the bars.

Returns
-------
list of `.Annotation`
    A list of `.Annotation` instances for the labels.
)r3   har2   vazPassing z! to bar_label() is not supported.c                     U S:  a  S$ S$ )Nr   r  rb   )r   s    r   signAxes.bar_label.<locals>.signV  s    Q1&B&r   r  r   )r  r  r   Nr<  r  )rq   rq   c                     [         R                  R                  UR                  U 5      UR	                  5       5      =(       d    [         R                  R                  5       $ rZ   )r   Bboxintersectionget_window_extentget_clip_boxnull)r  r  s     r   <lambda> Axes.bar_label.<locals>.<lambda>  sI    #((55//2ANN4D 5(--2245r   r   r  )r   r   r   r   r   r   r  zfmt must be a str or callablezoffset points)r   r  r  )r   r  get_view_intervalr  r   r  r  r  r  r,  r  get_segmentsr  zip_longestget_bbox
get_pointsrI  rH  absr  r  isnanr   r  r9   _auto_format_strcallabler   r   r   )-r(   	containerrM   rb  r  r  rC   keyr   r  
y_invertedr  r  
x_invertedr	  barsr  r  r,  r  barlinecols
barlinecolerrsannotationsr  r  datr  r  r  x1y1xcycextremalengthendptvaluer   y_directionr   x_directionr  r  
annotations-                                                r   	bar_labelAxes.bar_label  s   h LC} sg%FGI I L
 zz++-U
zz++-U
	' 	FH-*E  %%))
++NNE(K$QJ**,DD>F"+"7"7dJ#
Cc3 "%!:!:!<HRhr22g]R"WMBj(),#b"+s2r{R"W),#b"+s2r{R"W{bggcla/
*+.!8AqD	QT+.!8AqD	QTX%S	F*X% # 5 z" *,UBBj($.bAK$s)3g==$.bA$tCy07:A=X%+B*,!B!&)AgU8&)AgU8!(+aWV(+aWV!Bxx}}{c3''00e<Cc]]e*C#$CDDs')6?>M*,?7=?J z*W#
Z r   c                 T   [        U5      (       a  [        R                  " U5      OSn[        U5      (       a  [        R                  " U5      OSnU R                  SU4SU4/USS9  / nUu  pxU R	                  XwU-   45      u  pyU H8  n
 U
u  pU R                  XU-   45      u  pUR                  X4X4X4X4/5        M:     [        R                  " [        R                  " U5      40 UD6nU R                  USS9  U R                  5         U$ ! [
         a    [        S5      Sef = f)	a  
Plot a horizontal sequence of rectangles.

A rectangle is drawn for each element of *xranges*. All rectangles
have the same vertical position and size defined by *yrange*.

Parameters
----------
xranges : sequence of tuples (*xmin*, *xwidth*)
    The x-positions and extents of the rectangles. For each tuple
    (*xmin*, *xwidth*) a rectangle is drawn from *xmin* to *xmin* +
    *xwidth*.
yrange : (*ymin*, *yheight*)
    The y-position and extent for all the rectangles.

Returns
-------
`~.collections.PolyCollection`

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER
**kwargs : `.PolyCollection` properties

    Each *kwarg* can be either a single argument applying to all
    rectangles, e.g.::

        facecolors='black'

    or a sequence of arguments over which is cycled, e.g.::

        facecolors=('black', 'blue')

    would create interleaving black and blue rectangles.

    Supported keywords:

    %(PolyCollection:kwdoc)s
Nr   r,   Fr  z_each range in xrange must be a sequence with two elements (i.e. xrange must be an (N, 2) array)Tr
  )r   r9   r  r   r  	Exceptionr   r  r   r  PolyCollectionr  arrayr  r   )r(   xrangesyrangerC   xdataydataverticesr  r|  r'  xrr  r{  r&  cols                  r   broken_barhAxes.broken_barh  sD   X 69\\((1t47KK((0T5\C<(&% 	  	A $$br']3BP
 (("2g7FBOObXx"B8DE  ""288H#5@@C.$$&
  P EFKOPPs   DD'r<  )linefmt	markerfmtbasefmtr   r@   r,  c          	         S[        U5      s=::  a  S::  d#  O  [        R                  " SS[        U5      5      e[        R                  " SS/US9  [        U5      S:X  a&  Uu  n[        R
                  " [        U5      5      n	SnO?[        US   [        5      (       a#  Utp[        R
                  " [        U5      5      n	OUtpnUS:X  a  U R                  S	U	4S
U4/5      u  pOU R                  S	U4S
U	4/5      u  pUc  [        U5      S:  a  US   OSn[        U5      u  pnUc  SnUS:X  a  Sn[        U5      u  pnUc  SnUc  SnUc  UnUc  [        R                  S   (       a  SOSn[        U5      u  nnnU
c  [        R                  S   n
US:X  a  U R                  OU R                  nU" XUXSS9nUS:X  a4  UnU	nXD/n[        R                  " U	5      [        R                  " U	5      /nO3U	nUn[        R                  " U	5      [        R                  " U	5      /nXD/nU R!                  UUXUSS9u  nU R!                  UUUUUSS9u  n[#        UUU4US9nU R%                  U5        U$ )av	  
Create a stem plot.

A stem plot draws lines perpendicular to a baseline at each location
*locs* from the baseline to *heads*, and places a marker there. For
vertical stem plots (the default), the *locs* are *x* positions, and
the *heads* are *y* values. For horizontal stem plots, the *locs* are
*y* positions, and the *heads* are *x* values.

Call signature::

  stem([locs,] heads, linefmt=None, markerfmt=None, basefmt=None)

The *locs*-positions are optional. *linefmt* may be provided as
positional, but all other formats must be provided as keyword
arguments.

Parameters
----------
locs : array-like, default: (0, 1, ..., len(heads) - 1)
    For vertical stem plots, the x-positions of the stems.
    For horizontal stem plots, the y-positions of the stems.

heads : array-like
    For vertical stem plots, the y-values of the stem heads.
    For horizontal stem plots, the x-values of the stem heads.

linefmt : str, optional
    A string defining the color and/or linestyle of the vertical lines:

    =========  =============
    Character  Line Style
    =========  =============
    ``'-'``    solid line
    ``'--'``   dashed line
    ``'-.'``   dash-dot line
    ``':'``    dotted line
    =========  =============

    Default: 'C0-', i.e. solid line with the first color of the color
    cycle.

    Note: Markers specified through this parameter (e.g. 'x') will be
    silently ignored. Instead, markers should be specified using
    *markerfmt*.

markerfmt : str, optional
    A string defining the color and/or shape of the markers at the stem
    heads. If the marker is not given, use the marker 'o', i.e. filled
    circles. If the color is not given, use the color from *linefmt*.

basefmt : str, default: 'C3-' ('C2-' in classic mode)
    A format string defining the properties of the baseline.

orientation : {'vertical', 'horizontal'}, default: 'vertical'
    The orientation of the stems.

bottom : float, default: 0
    The y/x-position of the baseline (depending on *orientation*).

label : str, optional
    The label to use for the stems in legends.

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

Returns
-------
`.StemContainer`
    The container may be treated like a tuple
    (*markerline*, *stemlines*, *baseline*)

Notes
-----
.. seealso::
    The MATLAB function
    `stem <https://www.mathworks.com/help/matlab/ref/stem.html>`_
    which inspired this method.
r     stemz1-3r1  r<  r  rb   r   r,   r   zC0-r  r   r  _internal.classic_modezC2-zC3-zlines.linestyler  r  )r5   r9  r  r@   )r@   )r   r   nargs_errorr  r  r  r   r  r   r   r6   r7   r*  r'  rH  rI  r\  r   r  )r(   r@  rA  rB  r   r@   r,  rV   headslocsr9  
linemarker	linecolormarkerstylemarkermarkermarkercolor	basestyle
basemarker	basecolorxlines	stemlinesmarker_xmarker_y
baseline_x
baseline_y
markerliner/   stem_containers                               r   rE  	Axes.stem  s   d CI""""65#d)<<L*5;Ot9>FE99SZ(DDQ%%LE99SZ(D!%D$*$11C;e2MNKD%11C<#t2MNKE ?!$TQd1gEG+?+H(	y I?I + 	/;L K#K ? #-E Fu +?+H(	:y %67I +z 9t{{%,H	 ,&HH )J&&,t5JHH&&,t5J )Jii(&1'3<   I
 IIj*$-%/|  E	 '
Ix'H-24>*r   explode)r   r\  rM   r  )	normalizer  c                ~
  ^) U R                  S5        [        R                  " U[        R                  5      nUR                  S:  a  [        S5      e[        R                  " US:  5      (       a  [        S5      eUR                  5       nU(       a  UU-  nOUS:  a  [        S5      eUc  S/[        U5      -  nUc  S/[        U5      -  n[        U5      [        U5      :w  a  [        S[        U5       35      e[        U5      [        U5      :w  a  [        S	[        U5       35      eUc  U R                  R                  nO[        R                  " U5      m)U)4S
 jn[        R                  " [        R                  " U5      5      n[        R                  " [         XS9  U
S::  a  [        SU
 35      eU	S-  nUc  0 nUc  0 n/ n/ n/ n[#        XU5       GH  u  nnnUu  nnU(       a  UU-   OUU-
  nS[        R$                  -  S-  UU-   -  nUU[&        R(                  " U5      -  -  nUU[&        R*                  " U5      -  -  n[,        R.                  " UU4U
S[1        UU5      -  S[3        UU5      -  U" 5       [5        U5      SUS9n U R6                  " S)0 UD6  UR9                  U 5        U R;                  U 5        U(       aR  SSSS.n![=        U[>        5      (       a  U!RA                  U5        U R;                  [,        RB                  " U 40 U!D65        Ub  XU
-  [&        R(                  " U5      -  -   n"UX-  [&        R*                  " U5      -  -   n#U"S:  a  SOSn$Sn%Sn&U(       a+  U#S:  a  SOSn%[        RD                  " U5      U"S:  a  SOS-   n&U RG                  U"U#USU$U%U&[H        RJ                  S   S9n'U'R6                  " S)0 UD6  UR9                  U'5        Ub  XU
-  [&        R(                  " U5      -  -   n"UXj-  [&        R*                  " U5      -  -   n#[=        U[L        5      (       a	  USU-  -  n(O'[O        U5      (       a  U" SU-  5      n(O[Q        S 5      e[H        RR                  " URU                  S!5      S"5      (       a  [V        RX                  " S#S$U(5      n(U RG                  U"U#U(SSSS%9n'U'R6                  " S)0 UD6  UR9                  U'5        UnGM     U(       a  U R[                  5         O/U R7                  S/ / S&US   -   S'US   -   4S&US   -   S'US   -   4S(9  Uc  UU4$ UUU4$ )*a-  
Plot a pie chart.

Make a pie chart of array *x*.  The fractional area of each wedge is
given by ``x/sum(x)``.

The wedges are plotted counterclockwise, by default starting from the
x-axis.

Parameters
----------
x : 1D array-like
    The wedge sizes.

explode : array-like, default: None
    If not *None*, is a ``len(x)`` array which specifies the fraction
    of the radius with which to offset each wedge.

labels : list, default: None
    A sequence of strings providing the labels for each wedge

colors : :mpltype:`color` or list of :mpltype:`color`, default: None
    A sequence of colors through which the pie chart will cycle.  If
    *None*, will use the colors in the currently active cycle.

hatch : str or list, default: None
    Hatching pattern applied to all pie wedges or sequence of patterns
    through which the chart will cycle. For a list of valid patterns,
    see :doc:`/gallery/shapes_and_collections/hatch_style_reference`.

    .. versionadded:: 3.7

autopct : None or str or callable, default: None
    If not *None*, *autopct* is a string or function used to label the
    wedges with their numeric value. The label will be placed inside
    the wedge. If *autopct* is a format string, the label will be
    ``fmt % pct``. If *autopct* is a function, then it will be called.

pctdistance : float, default: 0.6
    The relative distance along the radius at which the text
    generated by *autopct* is drawn. To draw the text outside the pie,
    set *pctdistance* > 1. This parameter is ignored if *autopct* is
    ``None``.

labeldistance : float or None, default: 1.1
    The relative distance along the radius at which the labels are
    drawn. To draw the labels inside the pie, set  *labeldistance* < 1.
    If set to ``None``, labels are not drawn but are still stored for
    use in `.legend`.

shadow : bool or dict, default: False
    If bool, whether to draw a shadow beneath the pie. If dict, draw a shadow
    passing the properties in the dict to `.Shadow`.

    .. versionadded:: 3.8
        *shadow* can be a dict.

startangle : float, default: 0 degrees
    The angle by which the start of the pie is rotated,
    counterclockwise from the x-axis.

radius : float, default: 1
    The radius of the pie.

counterclock : bool, default: True
    Specify fractions direction, clockwise or counterclockwise.

wedgeprops : dict, default: None
    Dict of arguments passed to each `.patches.Wedge` of the pie.
    For example, ``wedgeprops = {'linewidth': 3}`` sets the width of
    the wedge border lines equal to 3. By default, ``clip_on=False``.
    When there is a conflict between these properties and other
    keywords, properties passed to *wedgeprops* take precedence.

textprops : dict, default: None
    Dict of arguments to pass to the text objects.

center : (float, float), default: (0, 0)
    The coordinates of the center of the chart.

frame : bool, default: False
    Plot Axes frame with the chart if true.

rotatelabels : bool, default: False
    Rotate each label to the angle of the corresponding slice if true.

normalize : bool, default: True
    When *True*, always make a full pie by normalizing x so that
    ``sum(x) == 1``. *False* makes a partial pie if ``sum(x) <= 1``
    and raises a `ValueError` for ``sum(x) > 1``.

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

Returns
-------
patches : list
    A sequence of `matplotlib.patches.Wedge` instances

texts : list
    A list of the label `.Text` instances.

autotexts : list
    A list of `.Text` instances for the numeric labels. This will only
    be returned if the parameter *autopct* is not *None*.

Notes
-----
The pie chart will probably look best if the figure and Axes are
square, or the Axes aspect is equal.
This method sets the aspect ratio of the axis to "equal".
The Axes aspect ratio can be controlled with `.Axes.set_aspect`.
equalr  zx must be 1Dr   z+Wedge sizes 'x' must be non negative valuesz/Cannot plot an unnormalized pie with sum(x) > 1r  z$'labels' must be of length 'x', not z%'explode' must be of length 'x', not c                     > [        T 5      $ rZ   )next)color_cycles   r   r   Axes.pie.<locals>.get_next_color5  s    K((r   )radius
startanglez('radius' must be a positive number, not ih  r  rq   g     v@F)rr   r  r   r@   g{Gzr  )oxoyr@   r   r   r   r1  r   r      zxtick.labelsize)r   r3   r2   rotationr  g      Y@z+autopct must be callable or a format stringusetexztext.usetexz([^\\])%z\1\\%)r   r3   r2   g      g      ?)frame_onxticksyticksxlimylimrb   ).
set_aspectr  rA  float32ndimr   r=  sumr   r  r  r  r  r  r   check_isinstancer   r   pimathcossinr   WedgerH  rI  ra  setr   r   r   dictr>   Shadowrad2degr   r6   r7   r  r  r   
_val_or_rcr   resubr   )*r(   r   r\  rM   r  autopctpctdistanceshadowlabeldistancere  rd  counterclock
wedgeprops	textpropsr   framerotatelabelsr]  r  sxr  hatch_cycletheta1textsslices	autotextsfracr@   explr,   theta2thetamr  shadow_dictxtytlabel_alignment_hlabel_alignment_vlabel_rotationr   r   rb  s*                                            @r   pieAxes.pie  s   p 	  JJq"**%66A:^,,66!a%==JKKUUWBA!VNOO>TCF]F?cCFlGq6S[ CCK=QRRq6S\!DS\NSTT>!77FFN#//&1K)  oobmmE&:;d6IQ;GxPQQ c!JI	!$Q!8D%DAq(4ftm6D=FY_8F(((A(((A1vvtc&&6I/I#c&&&99)7)9%)+%6',%*,A EEJMM!NN1 &+%,Ofd++&&v.xq@K@A(/$((62BBB/$((62BBB.01fF'!$,!!-46F%&(jj&8.01f#'?NIIb"e&+2C0A'5#&<<0A#B  D "	"Q"v-0@@@-0@@@gs++4$;/Ag&&t,A#EG G>>)--"9=II{Ha8AIIb"a&+2:08  : "	"  #FA "9D ((*HHeBr 6!9,dVAY.>? 6!9,dVAY.>?  A ?5= 5)++r   c                    [        U[        5      (       a  SU4n[        U[        5      (       ac  [        U5      S:X  aD  [        US   [        5      (       a,  [        US   [        5      (       a  [	        US   SUS   5      nOl[        SU< S35      e[        U[        5      (       a  OF[        U[        5      (       d!  [        R                  " U5      (       a   X     O[        SU< S35      e[        R                  " [        U 5      [        5      nS	X1'   U$ ! [
        [        4 a  n[        SU< S35      UeSnAff = f)
z
Normalize `errorbar`'s *errorevery* to be a boolean mask for data *x*.

This function is split out to be usable both by 2D and 3D errorbars.
r   r  r  Nzerrorevery=z! is a not a tuple of two integerszE is iterable but not a valid NumPy fancy index to match 'xerr'/'yerr'z is not a recognized valueT)r   r   tupler   slicer   r  r  r  r  zerosbool)r   
erroreveryr  	everymasks       r   _errorevery_to_maskAxes._errorevery_to_mask  s-    j(++ZJj%((J1$z!}h77z!}h77":a=$
1F
 "zo%FGI I
E**J,,Z1H1H= 
.HIJJHHSVT*	 $	 
+ = "zo &3 349<==s   D D>(D99D>r  )r   r,   r  r  c                    [         R                  " U[        R                  5      nUR	                  5        VVs0 s H  u  nnUc  M  UU_M     nnnUR                  SS5        [        U[        R                  5      (       d  [        R                  " U[        S9n[        U[        R                  5      (       d  [        R                  " U[        S9nS nUb'  [        U[        R                  5      (       d  U" U5      nUb'  [        U[        R                  5      (       d  U" U5      n[        R                  " X5      u  p[        U5      [        U5      :w  a  [        S5      eU R                  X5      nUR                  SS5      nSUS'   U R                   R#                  XS	:X  a  X4OXU4US
S9u  u  nnU	(       a  UR%                  US   S-
  5        OUR%                  US   S-   5        UR'                  5       S:w  a  U R)                  U5        O-SnUR                  S5        SU;   a  UR                  S5      US'   SU;  a  SUS'   Uc  US   nS H  nUR                  US5        M     0 UESU0EnUb  UUS'   OSU;   a  US   US'   S H  nUU;   d  M  UU   UU'   M     0 UESS0EnUc  [*        R,                  S   nUS:  a  SU-  US'   Ub  UUS'   S H  nUU;   d  M  UU   UU'   M     UUS'   / n/ / S.nS nSXXX R.                  S[        R0                  [        R2                  4
SX#XXR4                  S[        R6                  [        R8                  4
4 GHH  u
  nnn pn!n"n#n$n%U c  M  [        R:                  " U
[        U5      5      R=                  [>        5      n
[        R:                  " U[        U5      5      R=                  [>        5      n [        R:                  " U S[        U5      45        U RB                  [        RB                  " [        5      L a-  [        RD                  " U S:H  5      (       a  [        S U S%35      e[        RF                  " U R@                  [>        S9n&[        RD                  " [        RH                  " U U * U&U U :H  S&95      (       a  [        S U S'35      eU[        RJ                  " S(U
-
  * S(U-
  /5      U -  -   u  n'n(URM                  U"" U" U!U'U(/U5      0 UD65        U RN                  S):X  a-  US:X  a'  U H!  n)U)RQ                  5        H
  n*SU*l)        M     M#     X-  ) n+U+RE                  5       (       ai  US:  ac  U" U!U'U(/U+U-  5      u  n,n-n.U-U.4 HH  n/[        R                  " U,U,4S*U#0UD6n0U0RT                  " S/0 U S+3U/0D6  UU   RM                  U05        MJ     [W        U
U(4UU'4/5       H  u  n1u  n2n3U2RE                  5       (       d  M   U RX                  U   R[                  5       U1-  (       a  U%OU$n4U" XU3/U2U-  5      u  n5n6n7[        R                  " U5U64S*U40UD6n0U0RT                  " S/0 U S+3U70D6  UU   RM                  U05        US:  d  M  UU   RM                  [        R                  " U5U64S*U#0UD65        M     GMK     U RN                  S):X  a  U R\                  n8U H  n9UU9    H  n:[_        U:Ra                  5       U:Rc                  5       5       H  u  n;n<[e        U;U8S,9n=U9S:X  a8  U=[f        Rh                  " 5       Rk                  [        Rl                  S-  5      -  n=[n        Rp                  " W#U=S-9n>U R)                  [        R                  " U;/U</4S*U>0UD65        M     M     M     O&U H   n9UU9    H  n:U R)                  U:5        M     M"     U Rs                  5         US   US   -   n[u        U[w        U5      [w        U5      4USLUSLUS.9n?U Ry                  U?5        U?$ s  snnf ! [         aB    [        S U S![        R@                  " U 5       S"U S#[        R@                  " U5       S$3	5      Sef = f)0am  
Plot y versus x as lines and/or markers with attached errorbars.

*x*, *y* define the data locations, *xerr*, *yerr* define the errorbar
sizes. By default, this draws the data markers/lines as well as the
errorbars. Use fmt='none' to draw errorbars without any data markers.

.. versionadded:: 3.7
   Caps and error lines are drawn in polar coordinates on polar plots.


Parameters
----------
x, y : float or array-like
    The data positions.

xerr, yerr : float or array-like, shape(N,) or shape(2, N), optional
    The errorbar sizes:

    - scalar: Symmetric +/- values for all data points.
    - shape(N,): Symmetric +/-values for each data point.
    - shape(2, N): Separate - and + values for each bar. First row
      contains the lower errors, the second row contains the upper
      errors.
    - *None*: No errorbar.

    All values must be >= 0.

    See :doc:`/gallery/statistics/errorbar_features`
    for an example on the usage of ``xerr`` and ``yerr``.

fmt : str, default: ''
    The format for the data points / data lines. See `.plot` for
    details.

    Use 'none' (case-insensitive) to plot errorbars without any data
    markers.

ecolor : :mpltype:`color`, default: None
    The color of the errorbar lines.  If None, use the color of the
    line connecting the markers.

elinewidth : float, default: None
    The linewidth of the errorbar lines. If None, the linewidth of
    the current style is used.

capsize : float, default: :rc:`errorbar.capsize`
    The length of the error bar caps in points.

capthick : float, default: None
    An alias to the keyword argument *markeredgewidth* (a.k.a. *mew*).
    This setting is a more sensible name for the property that
    controls the thickness of the error bar cap in points. For
    backwards compatibility, if *mew* or *markeredgewidth* are given,
    then they will over-ride *capthick*. This may change in future
    releases.

barsabove : bool, default: False
    If True, will plot the errorbars above the plot
    symbols. Default is below.

lolims, uplims, xlolims, xuplims : bool or array-like, default: False
    These arguments can be used to indicate that a value gives only
    upper/lower limits.  In that case a caret symbol is used to
    indicate this. *lims*-arguments may be scalars, or array-likes of
    the same length as *xerr* and *yerr*.  To use limits with inverted
    axes, `~.Axes.set_xlim` or `~.Axes.set_ylim` must be called before
    :meth:`errorbar`.  Note the tricky parameter names: setting e.g.
    *lolims* to True means that the y-value is a *lower* limit of the
    True value, so, only an *upward*-pointing arrow will be drawn!

errorevery : int or (int, int), default: 1
    draws error bars on a subset of the data. *errorevery* =N draws
    error bars on the points (x[::N], y[::N]).
    *errorevery* =(start, N) draws error bars on the points
    (x[start::N], y[start::N]). e.g. errorevery=(6, 3)
    adds error bars to the data at (x[6], x[9], x[12], x[15], ...).
    Used to avoid overlapping error bars when two series share x-axis
    values.

Returns
-------
`.ErrorbarContainer`
    The container contains:

    - data_line : A `~matplotlib.lines.Line2D` instance of x, y plot markers
      and/or line.
    - caplines : A tuple of `~matplotlib.lines.Line2D` instances of the error
      bar caps.
    - barlinecols : A tuple of `.LineCollection` with the horizontal and
      vertical error ranges.

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    All other keyword arguments are passed on to the `~.Axes.plot` call
    drawing the markers. For example, this code makes big red squares
    with thick green edges::

        x, y, yerr = rand(3, 10)
        errorbar(x, y, yerr, marker='s', mfc='red',
                 mec='green', ms=20, mew=4)

    where *mfc*, *mec*, *ms* and *mew* are aliases for the longer
    property names, *markerfacecolor*, *markeredgecolor*, *markersize*
    and *markeredgewidth*.

    Valid kwargs for the marker properties are:

    - *dashes*
    - *dash_capstyle*
    - *dash_joinstyle*
    - *drawstyle*
    - *fillstyle*
    - *linestyle*
    - *marker*
    - *markeredgecolor*
    - *markeredgewidth*
    - *markerfacecolor*
    - *markerfacecoloralt*
    - *markersize*
    - *markevery*
    - *solid_capstyle*
    - *solid_joinstyle*

    Refer to the corresponding `.Line2D` property for more details:

    %(Line2D:kwdoc)s
Nr^   r  r  c                    [         R                  " U 5      (       a  [        U 5      S:  a  [        [        R
                  " U 5      [         R                  5      (       aS  [        [        R
                  " U 5      5      nU[         R                  L a  [         R                  " U [        S9$ U" U 5      $ [         R                  " U [        S9$ )a  
Safely handle tuple of containers that carry units.

This function covers the case where the input to the xerr/yerr is a
length 2 tuple of equal length ndarray-subclasses that carry the
unit information in the container.

If we have a tuple of nested numpy array (subclasses), we defer
coercing the units to be consistent to the underlying unit
library (and implicitly the broadcasting).

Otherwise, fallback to casting to an object array.
r   r  )
r  r  r   r   r9   r  r  r  rA  object)r  atypes     r   _upcast_err"Axes.errorbar.<locals>._upcast_errP  s    " KK$$HqL
 u77<bjjII U55c:;BJJ& ::c88 Sz!::c00r   z#'x' and 'y' must have the same sizer@   r  r  T)return_kwargs皙?rp   r5   C0)r  
markersizemarkerfacecolormarkerfacecoloraltmarkeredgewidthmarkeredgecolor	markeveryr9  	fillstyler  dash_capstyledash_joinstylesolid_capstylesolid_joinstyledashesr8  )r]   rt   r^   
rasterizedr9  r  r          @r  r  )r  r]   rt   r^   r  )r   r,   c                 6    U  Vs/ s H  o"U   PM	     sn$ s  snf rZ   rb   )arraysmaskr6  s      r   
apply_mask!Axes.errorbar.<locals>.apply_mask  s    -34VE$KV444s   r   |r,   _'zerr' (shape: zE) must be a scalar or a 1D or (2, n) array-like whose shape matches 'z
' (shape: )z@err' must not contain None. Use NaN if you want to skip a value.)outr  z%err' must not contain negative valuesr  polarr  rX  )thetatrans_shift)r  r]   )has_xerrhas_yerrr@   rb   )=r9   rZ  r   r   rv  rd   r   r  r  rA  r  r  r   r   r  r  r[  
_plot_args
set_zorderr&   r   r6   r7   r'  CARETRIGHTBASECARETLEFTBASEr*  CARETUPBASECARETDOWNBASEr  astyper  shaper  r=  r  lessvstackr   r   	get_pathsr   rz  	enumerate	_axis_mapget_inverted
transShiftr   	get_xdata	get_ydatar   r   Affine2Drotateru  mmarkersMarkerStyler   r   r  r  )@r(   r   r,   r  r  rb  r  
elinewidthr  	barsabovelolimsuplimsxlolimsxuplimsr  capthickrC   ry  rz  r  r  r@   	data_line
base_styler  eb_lines_styleeb_cap_stylebarcolscaplinesr  dep_axisdepr  indep
lines_funcr  lomarkerhimarkerreslowhighr  r   nolimsindep_masked	lo_masked	hi_masked	lh_maskedr   idxlimshlhlmarkerx_maskedy_masked	hl_maskedr  r   r   r  r  ri  mserrorbar_containers@                                                                   r   r  Axes.errorbar  s   Z ''>#)<<>C>41aQ$!Q$>C(A& !RZZ((

1F+A!RZZ((

1F+A%	1N JtRZZ$@$@t$DJtRZZ$@$@t$D}}Q"q6SVBCC,,Q;	

7D)&w $(??#=#=2I1&A#;d $> $T J   !1B!67  !1B!67 99;& MM)$I NN7#& &,jj&9
7#*$"&Jw>(FC NN3% 9J88!*4N;'F"*0*=N;'ACf}&,Sks# B
 ;*:k6:?ll#56GQ;)+gL&.6L*+,Cf}$*3KS!, !'W"%	5 awKKf++V-A-ACavq++f((&*>*>@-
)XsC
Xx {__VSX6==dCF__VSX6==dCFHaS]3 yyBHHV,,t1D1D z "; ;< < ((399D1CvvbggcC4SEFF z!FGI I bii1v:F
(CDsJJICNN:UC.	:N>LN OyyG#C A[[]12. + ! 'Fzz||!5?C&(:6<2i"+Y!7I "==| H06H:FHDHH>8*D 19=>X&--d3 "8 $-vtnvsm-L#MZdBxxzz ~~h/<<>D !  1;2Jy 012-(I }}Xx F,4F8DF:xj-y9:"))$/Q;X&--fmm (/K39/K=I/K L $Ng-
H 99//K !$A$'q{{}$Eq#2K#X3;$(<(<(>(E(Ebeeai(PPH%11<DFfmmUGaS 'D 'D6B'D E %F ( ! !!$AMM!$ ( ! 	$$&C=8C=0.hw8$&4t3C 	-.!!S Dn  H zrxx}o > zBHHSM?!=> DHHHs   
``"`Aa%notchrM   r  c                    Uc  [         R                  S   nU
c  [         R                  S   n
[        R                  " XU
UUS9nUc  [         R                  S   nU	c  [         R                  S   n	Uc  [         R                  S   nUc  [         R                  S   nUc  [         R                  S   nUc  [         R                  S	   nUc  [         R                  S
   nUc  0 nUc  0 nUc  0 nUc  0 nUc  0 nUc  0 nU	(       a  SUS'   SU;   a  UR	                  S5      US'   Ub=  US:X  a  [        SSSS9nSnO)[        U5      u  nn n!U b  U US'   U!b  U!US'   U!US'   U!US'   Ub}  [        [        R                  " U5      5      [        U5      :w  d&  [        R                  " U5      S   [        U5      :w  a  [        S5      e[        UU5       H  u  n"n#U#c  M  U#U"S'   M     Ubv  [        U5      [        U5      :w  a  [        S5      e[        UU5       HC  u  n"n$U$c  M  [        U$5      S:w  a  [        S5      eU$S   b  U$S   U"S'   U$S   c  M;  U$S   U"S'   ME     U R                  UXxXIX.UUUUUUUUUUUUUUUS9n%U%$ ) aJ!  
Draw a box and whisker plot.

The box extends from the first quartile (Q1) to the third
quartile (Q3) of the data, with a line at the median.
The whiskers extend from the box to the farthest data point
lying within 1.5x the inter-quartile range (IQR) from the box.
Flier points are those past the end of the whiskers.
See https://en.wikipedia.org/wiki/Box_plot for reference.

.. code-block:: none

          Q1-1.5IQR   Q1   median  Q3   Q3+1.5IQR
                       |-----:-----|
       o      |--------|     :     |--------|    o  o
                       |-----:-----|
     flier             <----------->            fliers
                            IQR


Parameters
----------
x : Array or a sequence of vectors.
    The input data.  If a 2D array, a boxplot is drawn for each column
    in *x*.  If a sequence of 1D arrays, a boxplot is drawn for each
    array in *x*.

notch : bool, default: :rc:`boxplot.notch`
    Whether to draw a notched boxplot (`True`), or a rectangular
    boxplot (`False`).  The notches represent the confidence interval
    (CI) around the median.  The documentation for *bootstrap*
    describes how the locations of the notches are computed by
    default, but their locations may also be overridden by setting the
    *conf_intervals* parameter.

    .. note::

        In cases where the values of the CI are less than the
        lower quartile or greater than the upper quartile, the
        notches will extend beyond the box, giving it a
        distinctive "flipped" appearance. This is expected
        behavior and consistent with other statistical
        visualization packages.

sym : str, optional
    The default symbol for flier points.  An empty string ('') hides
    the fliers.  If `None`, then the fliers default to 'b+'.  More
    control is provided by the *flierprops* parameter.

vert : bool, optional
    .. deprecated:: 3.11
        Use *orientation* instead.

        This is a pending deprecation for 3.10, with full deprecation
        in 3.11 and removal in 3.13.
        If this is given during the deprecation period, it overrides
        the *orientation* parameter.

    If True, plots the boxes vertically.
    If False, plots the boxes horizontally.

orientation : {'vertical', 'horizontal'}, default: 'vertical'
    If 'horizontal', plots the boxes horizontally.
    Otherwise, plots the boxes vertically.

    .. versionadded:: 3.10

whis : float or (float, float), default: 1.5
    The position of the whiskers.

    If a float, the lower whisker is at the lowest datum above
    ``Q1 - whis*(Q3-Q1)``, and the upper whisker at the highest datum
    below ``Q3 + whis*(Q3-Q1)``, where Q1 and Q3 are the first and
    third quartiles.  The default value of ``whis = 1.5`` corresponds
    to Tukey's original definition of boxplots.

    If a pair of floats, they indicate the percentiles at which to
    draw the whiskers (e.g., (5, 95)).  In particular, setting this to
    (0, 100) results in whiskers covering the whole range of the data.

    In the edge case where ``Q1 == Q3``, *whis* is automatically set
    to (0, 100) (cover the whole range of the data) if *autorange* is
    True.

    Beyond the whiskers, data are considered outliers and are plotted
    as individual points.

bootstrap : int, optional
    Specifies whether to bootstrap the confidence intervals
    around the median for notched boxplots. If *bootstrap* is
    None, no bootstrapping is performed, and notches are
    calculated using a Gaussian-based asymptotic approximation
    (see McGill, R., Tukey, J.W., and Larsen, W.A., 1978, and
    Kendall and Stuart, 1967). Otherwise, bootstrap specifies
    the number of times to bootstrap the median to determine its
    95% confidence intervals. Values between 1000 and 10000 are
    recommended.

usermedians : 1D array-like, optional
    A 1D array-like of length ``len(x)``.  Each entry that is not
    `None` forces the value of the median for the corresponding
    dataset.  For entries that are `None`, the medians are computed
    by Matplotlib as normal.

conf_intervals : array-like, optional
    A 2D array-like of shape ``(len(x), 2)``.  Each entry that is not
    None forces the location of the corresponding notch (which is
    only drawn if *notch* is `True`).  For entries that are `None`,
    the notches are computed by the method specified by the other
    parameters (e.g., *bootstrap*).

positions : array-like, optional
    The positions of the boxes. The ticks and limits are
    automatically set to match the positions. Defaults to
    ``range(1, N+1)`` where N is the number of boxes to be drawn.

widths : float or array-like
    The widths of the boxes.  The default is 0.5, or ``0.15*(distance
    between extreme positions)``, if that is smaller.

patch_artist : bool, default: :rc:`boxplot.patchartist`
    If `False` produces boxes with the Line2D artist. Otherwise,
    boxes are drawn with Patch artists.

tick_labels : list of str, optional
    The tick labels of each boxplot.
    Ticks are always placed at the box *positions*. If *tick_labels* is given,
    the ticks are labelled accordingly. Otherwise, they keep their numeric
    values.

    .. versionchanged:: 3.9
        Renamed from *labels*, which is deprecated since 3.9
        and will be removed in 3.11.

manage_ticks : bool, default: True
    If True, the tick locations and labels will be adjusted to match
    the boxplot positions.

autorange : bool, default: False
    When `True` and the data are distributed such that the 25th and
    75th percentiles are equal, *whis* is set to (0, 100) such
    that the whisker ends are at the minimum and maximum of the data.

meanline : bool, default: :rc:`boxplot.meanline`
    If `True` (and *showmeans* is `True`), will try to render the
    mean as a line spanning the full width of the box according to
    *meanprops* (see below).  Not recommended if *shownotches* is also
    True.  Otherwise, means will be shown as points.

zorder : float, default: ``Line2D.zorder = 2``
    The zorder of the boxplot.

Returns
-------
dict
  A dictionary mapping each component of the boxplot to a list
  of the `.Line2D` instances created. That dictionary has the
  following keys (assuming vertical boxplots):

  - ``boxes``: the main body of the boxplot showing the
    quartiles and the median's confidence intervals if
    enabled.

  - ``medians``: horizontal lines at the median of each box.

  - ``whiskers``: the vertical lines extending to the most
    extreme, non-outlier data points.

  - ``caps``: the horizontal lines at the ends of the
    whiskers.

  - ``fliers``: points representing data that extend beyond
    the whiskers (fliers).

  - ``means``: points or lines representing the means.

Other Parameters
----------------
showcaps : bool, default: :rc:`boxplot.showcaps`
    Show the caps on the ends of whiskers.
showbox : bool, default: :rc:`boxplot.showbox`
    Show the central box.
showfliers : bool, default: :rc:`boxplot.showfliers`
    Show the outliers beyond the caps.
showmeans : bool, default: :rc:`boxplot.showmeans`
    Show the arithmetic means.
capprops : dict, default: None
    The style of the caps.
capwidths : float or array, default: None
    The widths of the caps.
boxprops : dict, default: None
    The style of the box.
whiskerprops : dict, default: None
    The style of the whiskers.
flierprops : dict, default: None
    The style of the fliers.
medianprops : dict, default: None
    The style of the median.
meanprops : dict, default: None
    The style of the mean.
label : str or list of str, optional
    Legend labels. Use a single string when all boxes have the same style and
    you only want a single legend entry for them. Use a list of strings to
    label all boxes individually. To be distinguishable, the boxes should be
    styled individually, which is currently only possible by modifying the
    returned artists, see e.g. :doc:`/gallery/statistics/boxplot_demo`.

    In the case of a single string, the legend entry will technically be
    associated with the first box only. By default, the legend will show the
    median line (``result["medians"]``); if *patch_artist* is True, the legend
    will show the box `.Patch` artists (``result["boxes"]``) instead.

    .. versionadded:: 3.9

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

See Also
--------
.Axes.bxp : Draw a boxplot from pre-computed statistics.
violinplot : Draw an estimate of the probability density function.
zboxplot.whiskerszboxplot.bootstrap)whis	bootstraprM   	autorangezboxplot.notchzboxplot.patchartistzboxplot.meanlinezboxplot.showmeanszboxplot.showcapszboxplot.showboxzboxplot.showflierssolidr9  r5   rs   r  rp   )r9  r  r5   Fr  r  r  r   z,'usermedians' and 'x' have different lengthsmedz/'conf_intervals' and 'x' have different lengthsr  z-each confidence interval must have two valuescilor  cihi)r-  widthsvertpatch_artistshownotches	showmeansshowcapsshowboxboxprops
flierpropsmedianprops	meanpropsmeanline
showflierscappropswhiskerpropsmanage_ticksr^   	capwidthsr@   r,  )r6   r7   r9   boxplot_statsr  r{  r   r   r  r  r  r   r   bxp)&r(   r   r  symr  r,  r  r-  r  r  r	  usermediansconf_intervalsr  r  r  r  r  r  r  r  r  r  r  r  r  r
  r^   r  r@   bxpstatsr  r  r5   statsr  ciartistss&                                         r   boxplotAxes.boxplot2  s   Z <<< 23D%89I&&qy.9YP=LL1E<<(=>L||$67H%89I||$67H?ll#45G&:;JHLHKIJ$+H[!("(0W(=% ? by!F2VL
"

 $8#< 65%+1Jx($ +0Jw'49J0149J01 "BHH[)*c(m;HH[)!,H= BD D #&h"<JE3'*e #= %>"c(m3 EG G "%X~!>IE2~r7a<", .? #@ @  "!u0021f!!u0021f "? ((8y $',$,g$,'2i$,$,<(4V%.e'2  
4 r   r  c                 v  ^ ^^L SSS.U=(       d    0 EnSSS.U=(       d    0 En/ n/ n/ n/ n/ n/ n/ nTc  [         R                  R                  mSnSBU4S jjnU(       a  [        R                  S   [        R                  S	   [        R                  S
   [        R                  S   (       a  SO[        R                  S   TS.[
        R                  " U[        R                  5      EOU" SUSS9n U" SUSS9n!U" SUSS9n"U" SU5      n#U" SUUSS9n$U" SUU5      n%U(       a  SOSn&Ub  U&U;  a  SU%U&'   Uc  [        R                  S   nO[        R                  " SSSSS9  USL a  Sn[        R                  " SS /US!9  [        R                  S   (       d  [        R                  " S"SS#S$9  US :X  a  [        S5      O[        SSS%5      mLULU 4S& jn'ULU 4S' jn([        U5      n)S(n*Uc  [        [        S)U)S)-   5      5      nO)[        U5      U):w  a  [!        U*R#                  S*5      5      e[$        R&                  " U5      n[        U5      S:  a"  [)        S+ U 5       5      (       d  [+        S,5      eUc4  [$        R,                  " S-[$        R.                  " U5      -  S-S.5      /U)-  nOK[$        R0                  " U5      (       a  U/U)-  nO)[        U5      U):w  a  [!        U*R#                  S/5      5      eUc  S.[$        R&                  " U5      -  nOK[$        R0                  " U5      (       a  U/U)-  nO)[        U5      U):w  a  [!        U*R#                  S05      5      e[3        X#UU5       GH  u  n+n,n-n.UR5                  U-R7                  S1U+5      5        U+U+/n/U-S2   U-S3   /n0U-S4   U-S5   /n1U+U.S.-  -
  n2U+U.S.-  -   n3U2U3/n4[$        R8                  " S6U-S3   5      n5[$        R8                  " S6U-S5   5      n6U+U,S.-  -
  n7U+U,S.-  -   n8U-S7   U-S7   /n9U(       aP  U+U,S8-  -
  n:U+U,S8-  -   n;U7U8U8U;U8U8U7U7U:U7U7/n<U-S2   U-S2   U-S9   U-S7   U-S:   U-S4   U-S4   U-S:   U-S7   U-S9   U-S2   /n=U:U;/n>O!U7U8U8U7U7/n<U-S2   U-S2   U-S4   U-S4   U-S2   /n=U7U8/n>U
(       a6  U(       a  U(OU'n?UR5                  U?" U<U=40 U D65        U$R;                  S1S;5        U!R;                  S1S;5        UR5                  U'" U/U040 U!D65        UR5                  U'" U/U140 U!D65        U	(       aD  U"R;                  S1S;5        UR5                  U'" U4U540 U"D65        UR5                  U'" U4U640 U"D65        UR5                  U'" U>U940 U$D65        U(       aI  U(       a$  UR5                  U'" U7U8/U-S   U-S   /40 U%D65        OUR5                  U'" U+/U-S   /40 U%D65        U(       d  GM[  U#R;                  S1S;5        [$        R8                  " [        U-S<   5      U+[$        R<                  S=9n@U-S<   nAUR5                  U'" U@UA40 U#D65        GM     U(       a  U
(       a	  U(       a  UOUnB[
        R>                  " U5      (       a  WBS   RA                  U5        OY[        WB5      [        U5      :w  a  [!        U*R#                  S15      5      e[3        WBU5       H  u  nCnDUCRA                  UD5        M     U(       Ga  US :X  a  S>OS?nE[C        T RD                  S@UE 35      nFT RF                  UE   nGUGRI                  U5      n[K        UFS   [K        U5      S.-
  5      [M        UFS)   [M        U5      S.-   5      4UFSS& [3        UU5       H3  u  nHnI[C        UHRN                  WE5      RQ                  UIS.-
  UIS.-   /5        M5     WGRS                  5       nJ[U        UGRS                  5       [V        RX                  5      (       d'  [V        RX                  " / 5      nJWGR[                  UJ5        [$        R&                  " / WJR\                  QUQ5      UJl.        WGR_                  5       nK[U        UGR_                  5       [V        R`                  5      (       d'  [V        R`                  " / 5      nKWGRc                  UK5        / WKRd                  QUQUKl2        T Rg                  5         [i        UUUUUUSA9$ )Ca  
Draw a box and whisker plot from pre-computed statistics.

The box extends from the first quartile *q1* to the third
quartile *q3* of the data, with a line at the median (*med*).
The whiskers extend from *whislow* to *whishi*.
Flier points are markers past the end of the whiskers.
See https://en.wikipedia.org/wiki/Box_plot for reference.

.. code-block:: none

           whislow    q1    med    q3    whishi
                       |-----:-----|
       o      |--------|     :     |--------|    o  o
                       |-----:-----|
     flier                                      fliers

.. note::
    This is a low-level drawing function for when you already
    have the statistical parameters. If you want a boxplot based
    on a dataset, use `~.Axes.boxplot` instead.

Parameters
----------
bxpstats : list of dicts
    A list of dictionaries containing stats for each boxplot.
    Required keys are:

    - ``med``: Median (float).
    - ``q1``, ``q3``: First & third quartiles (float).
    - ``whislo``, ``whishi``: Lower & upper whisker positions (float).

    Optional keys are:

    - ``mean``: Mean (float).  Needed if ``showmeans=True``.
    - ``fliers``: Data beyond the whiskers (array-like).
      Needed if ``showfliers=True``.
    - ``cilo``, ``cihi``: Lower & upper confidence intervals
      about the median. Needed if ``shownotches=True``.
    - ``label``: Name of the dataset (str).  If available,
      this will be used a tick label for the boxplot

positions : array-like, default: [1, 2, ..., n]
    The positions of the boxes. The ticks and limits
    are automatically set to match the positions.

widths : float or array-like, default: None
    The widths of the boxes.  The default is
    ``clip(0.15*(distance between extreme positions), 0.15, 0.5)``.

capwidths : float or array-like, default: None
    Either a scalar or a vector and sets the width of each cap.
    The default is ``0.5*(width of the box)``, see *widths*.

vert : bool, optional
    .. deprecated:: 3.11
        Use *orientation* instead.

        This is a pending deprecation for 3.10, with full deprecation
        in 3.11 and removal in 3.13.
        If this is given during the deprecation period, it overrides
        the *orientation* parameter.

    If True, plots the boxes vertically.
    If False, plots the boxes horizontally.

orientation : {'vertical', 'horizontal'}, default: 'vertical'
    If 'horizontal', plots the boxes horizontally.
    Otherwise, plots the boxes vertically.

    .. versionadded:: 3.10

patch_artist : bool, default: False
    If `False` produces boxes with the `.Line2D` artist.
    If `True` produces boxes with the `~matplotlib.patches.Patch` artist.

shownotches, showmeans, showcaps, showbox, showfliers : bool
    Whether to draw the CI notches, the mean value (both default to
    False), the caps, the box, and the fliers (all three default to
    True).

boxprops, whiskerprops, capprops, flierprops, medianprops, meanprops : dict, optional
    Artist properties for the boxes, whiskers, caps, fliers, medians, and
    means.

meanline : bool, default: False
    If `True` (and *showmeans* is `True`), will try to render the mean
    as a line spanning the full width of the box according to
    *meanprops*. Not recommended if *shownotches* is also True.
    Otherwise, means will be shown as points.

manage_ticks : bool, default: True
    If True, the tick locations and labels will be adjusted to match the
    boxplot positions.

label : str or list of str, optional
    Legend labels. Use a single string when all boxes have the same style and
    you only want a single legend entry for them. Use a list of strings to
    label all boxes individually. To be distinguishable, the boxes should be
    styled individually, which is currently only possible by modifying the
    returned artists, see e.g. :doc:`/gallery/statistics/boxplot_demo`.

    In the case of a single string, the legend entry will technically be
    associated with the first box only. By default, the legend will show the
    median line (``result["medians"]``); if *patch_artist* is True, the legend
    will show the box `.Patch` artists (``result["boxes"]``) instead.

    .. versionadded:: 3.9

zorder : float, default: ``Line2D.zorder = 2``
    The zorder of the resulting boxplot.

Returns
-------
dict
    A dictionary mapping each component of the boxplot to a list
    of the `.Line2D` instances created. That dictionary has the
    following keys (assuming vertical boxplots):

    - ``boxes``: main bodies of the boxplot showing the quartiles, and
      the median's confidence intervals if enabled.
    - ``medians``: horizontal lines at the median of each box.
    - ``whiskers``: vertical lines up to the last non-outlier data.
    - ``caps``: horizontal lines at the ends of the whiskers.
    - ``fliers``: points representing data beyond the whiskers (fliers).
    - ``means``: points or lines representing the means.

See Also
--------
boxplot : Draw a boxplot from data instead of pre-computed statistics.
butt)r  r  Nr  r   Tc           	      f  > [         R                  R                  5        VVs0 s H6  u  pEUR                  SU  S35      (       d  M!  UR	                  S5      S   U_M8     nnnTU-   US'   U(       d  SUS'   UR                  [        R                  " U[        R                  5      5        U$ s  snnf )Nzboxplot.props.r  r^   r  r  )
r6   r7   rv  
startswithsplitr>   r9   rZ  r   r   )subkeyexplicitzdelta	usemarkerry  rz  r  r^   s          r   merge_kw_rcAxes.bxp.<locals>.merge_kw_rc8  s    141C1C1E <1ELL8F85!9: %b!1$1EA < 6/AhK (HHU++HfmmDEH<s    B-B-zboxplot.boxprops.linestylezboxplot.boxprops.linewidthzboxplot.boxprops.colorrG  whitezpatch.facecolor)r9  r8  rs   rr   r^   boxF)r5  whiskercapfliermedianmeanr  r9  r  zboxplot.vertical3.11
vert: bool'orientation: {'vertical', 'horizontal'}r   r^  pendingr1  r<  r  z3.10rcparam)r   obj_typer  c                 6   > TR                   " X/T   0 UD6S   $ Nr   )r\  )xsysrC   
maybe_swapr(   s      r   do_plotAxes.bxp.<locals>.do_plotm  s#    99rhz2=f=a@@r   c                    > [         R                  R                  [        R                  " X/T   5      5      n[
        R                  " U40 UD6nTR                  U5        U$ rZ   )mpathPath_create_closedr  column_stackr   	PathPatchr{   )rH  rI  rC   pathr   rJ  r(   s        r   do_patchAxes.bxp.<locals>.do_patchp  sP    ::,, 457D&&t6v6EOOE"Lr   zEList of boxplot statistics and `{0}` values must have same the lengthr  r-  c              3   B   #    U  H  n[        U[        5      v   M     g 7frZ   )r   r   )r4  r   s     r   r6  Axes.bxp.<locals>.<genexpr>  s     )Qy!*Q*=*=ys   z*positions should be an iterable of numbersg333333?rq   r  r  r@   q1whisloq3whishir  r        ?r  r  r  fliersr  r   r,   interval)whiskerscapsboxesmediansr]  means)r   T)5r   r   r^   r6   r7   r9   rZ  r   rR  r   warn_deprecatedr  r  r   rF  ranger   formatr  r6  allr   r  ptpisscalarr   r   r   r  rd   float64is_scalar_or_stringr   getattrr   r  convert_unitsrH  rI  r  extendget_major_locatorr   mtickerFixedLocatorset_major_locatorrJ  get_major_formatterFixedFormatterset_major_formatterseqr   r{  )Mr(   r%  r-  r  r  r,  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r^   r  r@   r_  r`  ra  rb  rc  r]  
datalabelsr4  r6  box_kw
whisker_kwcap_kwflier_kw	median_kwmean_kwremoved_proprK  rT  Ndatashape_messageposr  r&  capwidthwhis_xwhislo_ywhishi_ycap_left	cap_rightcap_xcap_locap_hibox_left	box_rightmed_y
notch_leftnotch_rightbox_xbox_ymed_xdo_boxflier_xflier_y
box_or_medartistr  	axis_namer^  r   r=  r5  locator	formatterrJ  sM   `                   `                                                       @r   r!  Axes.bxp  s   \ %#
  b
 %#
 B
	  
 >]]))F	"  &BC&BC&>?%(\\2J%K'"||,=>
 $$Xx/A/AB
  +5(eL 	 !LEJ
UH>w
3+vO	fi8#+xI =$&GL!
 <<< 23D  !E	 5=&KL*5;O||./  ') %0:$=U4[5tUWCX
	A	 M@ U1a!e_-I^q .55kBCCHHY'	y>Ac)Qy)Q&Q&QHII >ggdRVVI%66cBCaGF[[  X\F[A.55h?@@ bhhv..I[[##"aI^q .55kBCC+.y(/8,:'Cx eii56 3ZFdU8_5HdU8_5HX^+Hhn,Iy)EWWQh0FWWQh0FUS[(Heck)I5\5<0E 54</
!EDL0!9i"Ix:!8- teDk5=uuV}eDkteFmU5\vd5 $[1 "9i8LteDk5;dt&!9- %1wVE5;F;<$$Wl;!!'<8OOGFHC
CDOOGFHC
CD!!'<8GE6<V<=GE6<V<=NN75%=9=>LL!9-fuV}/M"!" 
 LL#v!K7!KLz##G\:''#eHo"62::N/ggwC(CDI,:N ")lJ((//1''.z?c%j0$%6%=%=g%FGG#&z5#9KFC$$S) $: *j8cIt||x	{-CDH>>),D**95I x{C	NR,?@x{C	NR,?@BHQK$'$; ++Y7>>]HrM24 %< ,,.Gd446%224 4!..r2&&w/88$?gll$?Y$?@GL002Id668%446 6#2226	((39imm9j9IM((*XD#F%A 	Ar   c                    UR                  SS5      nUR                  SU5      nUR                  SU5      nUR                  SS5      nUb  U b  [        S5      eUb!   [        R                  " U5        Uc  UnUc  UnUc+  [        R
                  S   (       d  [        R
                  S	   nU b  Ub  [        R                  " S
5        U SL nU c&  Ub  UO [        R
                  S   (       a  SOU" 5       n [        U [        5      =(       dV    [        R                  " U 5      =(       a9    [        U 5      S:  =(       a$    [        [        R                  " U 5      [        5      n	S n
SnSnU(       d  Uc  U	(       d   [        R                  " U [         S9n U R"                  S:X  d  U R"                  S:X  a  SnU R$                  U:w  a  SnOLU R$                  U:X  a  U R'                  5       n SnO)U R"                  S;   a  [        R                  " S5        Sn U(       d<   [        R                  " U 5      n[        U5      SSU4;  a  U
" [        U5      U5      eOSnXU4$ ! [         a  n[        S5      UeSnAff = f! [         a     Nsf = f! [(        [        4 a@  nS[        U5      ;   a  e U(       d  U
" U R$                  U5      Ue[        SU < 35      UeSnAff = f)a  
Helper function to process color related arguments of `.Axes.scatter`.

Argument precedence for facecolors:

- c (if not None)
- kwargs['facecolor']
- kwargs['facecolors']
- kwargs['color'] (==kwcolor)
- 'b' if in classic mode else the result of ``get_next_color_func()``

Argument precedence for edgecolors:

- kwargs['edgecolor']
- edgecolors (is an explicit kw argument in scatter())
- kwargs['color'] (==kwcolor)
- 'face' if not in classic mode else None

Parameters
----------
c : :mpltype:`color` or array-like or list of :mpltype:`color` or None
    See argument description of `.Axes.scatter`.
edgecolors : :mpltype:`color` or sequence of color or {'face', 'none'} or None
    See argument description of `.Axes.scatter`.
kwargs : dict
    Additional kwargs. If these keys exist, we pop and process them:
    'facecolors', 'facecolor', 'edgecolor', 'color'
    Note: The dict is modified by this function.
xsize : int
    The size of the x and y arrays passed to `.Axes.scatter`.
get_next_color_func : callable
    A callable that returns a color. This color is used as facecolor
    if no other color is provided.

    Note, that this is a function rather than a fixed color value to
    support conditional evaluation of the next color.  As of the
    current implementation obtaining the next color from the
    property cycle advances the cycle. This must only happen if we
    actually use the color, which will only be decided within this
    method.

Returns
-------
c
    The input *c* if it was not *None*, else a color derived from the
    other inputs or defaults.
colors : array(N, 4) or None
    The facecolors as RGBA values, or *None* if a colormap is used.
edgecolors
    The edgecolor.


facecolorsNrr   rs   r5   zeSupply a 'c' argument or a 'color' kwarg but not both; they differ but their functionalities overlap.z'color' kwarg must be a color or sequence of color specs.  For a sequence of values to be color-mapped, use the 'c' argument instead.rG  zscatter.edgecolorszYou passed both c and facecolor/facecolors for the markers. c has precedence over facecolor/facecolors. This behavior may change in the future.r  r   c                 &    [        SU  SU S35      $ )Nz'c' argument has z< elements, which is inconsistent with 'x' and 'y' with size r/  )r   )csizexsizes     r   invalid_shape_exception?Axes._parse_scatter_color_args.<locals>.invalid_shape_exceptionn  s'    #E7 +..3WA78 8r   FTr  )r     )r  rD  ))rD  )r  a<  *c* argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with *x* & *y*.  Please use the *color* keyword-argument or provide a 2D array with a single row if you intend to specify the same RGB or RGBA value for all points.r  z&RGBA values should be within 0-1 rangezR'c' argument must be a color, a sequence of colors, or a sequence of numbers, not )r  r   rB  rC  r6   r7   r   warn_externalr   r  r  r  r   r9   r  r>  r<   r  r  r  r   )r  
edgecolorsrC   r  get_next_color_funcr  kwcolorr  
c_was_nonec_is_string_or_stringsr  c_is_mappedvalid_shaper  s                 r   _parse_scatter_color_argsAxes._parse_scatter_color_args
  s   n ZZd3
ZZZ8
ZZZ8
**Wd+1= ? @ @ :%%g. !$
!$
cll3K&L&:;J =Z3: $Y
9)5 \\*BCc)+  q# BA A3q6A: Au77:C@ 	
	8
 go6L(MM!51 77f$6(9"'Kvv&+ VVu_	A"&Kww,.**IJ #(KF ..q1 v;q!Um3 2#f+uEE 4
 F*$$o  : 01 7:::R  8 z* 
I;s3xG&5affeD#M %99:?@EHI
IsB   I ;I< J 
I9(I44I9<
J	J	K;KKr  )	r   r,   r   r0  r  r  rr   r  r5   )r  	colorizerplotnonfinitec                (   Ub  UR                  SU05        Ub  UR                  SU05        [        R                  " U[        R                  5      nUR                  SS5      nUR                  SS5      nU R                  SU4SU4/U5      u  p[        R                  R                  U5      n[        R                  R                  U5      nUR                  UR                  :w  a  [        S5      eUc0  [        R                  S	   (       a  S
O[        R                  S   S-  n[        R                  R                  U5      n[        U5      SUR                  4;  dh  [        R                  " UR                   [        R"                  5      (       d?  [        R                  " UR                   [        R$                  5      (       d  [        S5      eUnUc  UR'                  SS5      nU R)                  XLXR                  U R*                  R,                  S9u  nnnU(       a?  Uc<  [        R                  R/                  U5      n[        R0                  " XX<U5      u  pp<nO[        R0                  " XX4UX5      u  pp4npUR                  S;   aT  [        R                  R3                  U5      (       a0  [        R                  R3                  U5      (       d  UR4                  nUnUc  [        R                  S   n[7        U[8        R:                  5      (       a  UnO[8        R:                  " U5      nUR=                  5       R?                  URA                  5       5      nURC                  5       (       d  Ub  [D        RF                  " SU< SU< S35        URI                  5       S:X  a  UnSnOSnUc  [        R                  S   nOC[        RJ                  " U5      (       a(  U Vs/ s H  nUb  UO[        R                  S   PM     nn[        R                  RM                  X/5      n[        RN                  " U4UUUUUUR                  SU RP                  5      U
S9nURS                  [T        RV                  " 5       5        Uc_  U(       a  URY                  XXxU	S9  O"UR[                  U5        UR]                  U5        UR_                  U5        URa                  XxU	5        OqXgXS.nURc                  5        VVs/ s H  u  nnUc  M  UPM     nnn[e        U5      (       a2  SRg                  S U 5       5      n[D        RF                  " SU S35        URi                  U5        [        R                  S	   (       ab  U Rj                  S:  a!  UR                  S :  a  U Rm                  S5        U Rn                  S:  a!  UR                  S :  a  U Rq                  S5        U Rs                  U5        U Ru                  5         U$ s  snf s  snnf )!a  
A scatter plot of *y* vs. *x* with varying marker size and/or color.

Parameters
----------
x, y : float or array-like, shape (n, )
    The data positions.

s : float or array-like, shape (n, ), optional
    The marker size in points**2 (typographic points are 1/72 in.).
    Default is ``rcParams['lines.markersize'] ** 2``.

    The linewidth and edgecolor can visually interact with the marker
    size, and can lead to artifacts if the marker size is smaller than
    the linewidth.

    If the linewidth is greater than 0 and the edgecolor is anything
    but *'none'*, then the effective size of the marker will be
    increased by half the linewidth because the stroke will be centered
    on the edge of the shape.

    To eliminate the marker edge either set *linewidth=0* or
    *edgecolor='none'*.

c : array-like or list of :mpltype:`color` or :mpltype:`color`, optional
    The marker colors. Possible values:

    - A scalar or sequence of n numbers to be mapped to colors using
      *cmap* and *norm*.
    - A 2D array in which the rows are RGB or RGBA.
    - A sequence of colors of length n.
    - A single color format string.

    Note that *c* should not be a single numeric RGB or RGBA sequence
    because that is indistinguishable from an array of values to be
    colormapped. If you want to specify the same RGB or RGBA value for
    all points, use a 2D array with a single row.  Otherwise,
    value-matching will have precedence in case of a size matching with
    *x* and *y*.

    If you wish to specify a single color for all points
    prefer the *color* keyword argument.

    Defaults to `None`. In that case the marker color is determined
    by the value of *color*, *facecolor* or *facecolors*. In case
    those are not specified or `None`, the marker color is determined
    by the next color of the ``Axes``' current "shape and fill" color
    cycle. This cycle defaults to :rc:`axes.prop_cycle`.

marker : `~.markers.MarkerStyle`, default: :rc:`scatter.marker`
    The marker style. *marker* can be either an instance of the class
    or the text shorthand for a particular marker.
    See :mod:`matplotlib.markers` for more information about marker
    styles.

%(cmap_doc)s

    This parameter is ignored if *c* is RGB(A).

%(norm_doc)s

    This parameter is ignored if *c* is RGB(A).

%(vmin_vmax_doc)s

    This parameter is ignored if *c* is RGB(A).

alpha : float, default: None
    The alpha blending value, between 0 (transparent) and 1 (opaque).

linewidths : float or array-like, default: :rc:`lines.linewidth`
    The linewidth of the marker edges. Note: The default *edgecolors*
    is 'face'. You may want to change this as well.

edgecolors : {'face', 'none', *None*} or :mpltype:`color` or list of :mpltype:`color`, default: :rc:`scatter.edgecolors`
    The edge color of the marker. Possible values:

    - 'face': The edge color will always be the same as the face color.
    - 'none': No patch boundary will be drawn.
    - A color or sequence of colors.

    For non-filled markers, *edgecolors* is ignored. Instead, the color
    is determined like with 'face', i.e. from *c*, *colors*, or
    *facecolors*.

%(colorizer_doc)s

    This parameter is ignored if *c* is RGB(A).

plotnonfinite : bool, default: False
    Whether to plot points with nonfinite *c* (i.e. ``inf``, ``-inf``
    or ``nan``). If ``True`` the points are drawn with the *bad*
    colormap color (see `.Colormap.set_bad`).

Returns
-------
`~matplotlib.collections.PathCollection`

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER
**kwargs : `~matplotlib.collections.PathCollection` properties
    %(PathCollection:kwdoc)s

See Also
--------
plot : To plot scatter plots when markers are identical in size and
    color.

Notes
-----
* The `.plot` function will be faster for scatterplots where markers
  don't vary in size or color.

* Any or all of *x*, *y*, *s*, and *c* may be masked arrays, in which
  case all masks will be combined and only unmasked points will be
  plotted.

* Fundamentally, scatter works with 1D arrays; *x*, *y*, *s*, and *c*
  may be input as N-D arrays, but within scatter they will be
  flattened. The exception is *c*, which will be flattened only if its
  size matches the size of *x* and *y*.

Nr  r0  r8  rs   r   r,   zx and y must be the same sizerG     zlines.markersizer  r  zEs must be a scalar, or float array-like with the same size as x and y)r  )rD  r  zscatter.markerz#You passed a edgecolor/edgecolors (z) for an unfilled marker (zl).  Matplotlib is ignoring the edgecolor in favor of the facecolor.  This behavior may change in the future.rp   facezlines.linewidthr]   )r  r  r0  offsetsoffset_transformrt   cmapnormvminvmaxz, c              3   .   #    U  H  nS U S 3v   M     g7f)r  Nrb   )r4  ry  s     r   r6  Axes.scatter.<locals>.<genexpr>  s     $Bz!q1Xzs   z6No data for colormapping provided via 'c'. Parameters z will be ignored皙?r   );r>   r9   rZ  r  
Collectionr  r   r  r  r  r  r   r6   r7   r   
issubdtyper  floatingintegerr   r  r  r  masked_invalidr  	is_maskedrX  r   r  r  r   transformedr  	is_filledr   r  get_fillstyler  rQ  PathCollectionrx   r   r   r   _set_colorizer_check_keywordsset_cmapset_norm	set_array_scale_normrv  r=  joinr?   _xmarginset_xmargin_ymarginset_ymarginr  r   )r(   r   r,   r   r  r  r  r  r  r  rt   r0  r  r  r  rC   orig_edgecolorr  scales
marker_objrS  r  r  
collectionextra_kwargsry  rz  
extra_keyskeys_strs                                r   scatterAxes.scatter  sL   R !MM<45!MM<45''0@0@A ZZT2
ZZT2
&&a3(';VD EEKKNEEKKN66QVV<==9||$<=01S8 EEKKNF1aff+%]]177BKK88]]177BJJ77DE E
 $#ZZT:N**vvv$($>$>$M$M + O 	6:
 V^$$Q'A$$Q1*E ,A! $$!
@ 7A!
 FFfEEOOJ//77#J >\\"23Ffh2233J!--f5J""$00$$&(##%%)""9.9K L//5j 999" '')V3#
   $
! \\*;<
Z(( )*( .Bcll;L.MM(  * %%$$aV,))GV!!#ZZT^^D

 	  !>!>!@A>88>B>B 9 D ##D)##D)  #""4t4 !L )5(:(:(<N(<1!(<JN:99$Bz$BB""""*+;=> 	##F+ <<01}}t#
  &}}t#
  &J'$$&i*< Os   *"X	
XXgridsize)r   r,   Cr  r   r  c           
         U R                  SU4SU4/USS9  [        R                  " XU5      u  pn[        R                  " U5      (       a  Uu  nnO$Un[        U[        R                  " S5      -  5      n[        R                  " U[        5      n[        R                  " U[        5      nUnUnUS:X  a?  [        R                  " US:*  5      (       a  [        S5      e[        R                  " U5      nUS:X  a?  [        R                  " US:*  5      (       a  [        S	5      e[        R                  " U5      nUb*  Uu  nnnnUU:  a  [        S5      eUU:  a  [        S5      eO[        U5      (       a   UR                  5       UR                  5       4OSu  nn[        U5      (       a   UR                  5       UR                  5       4OSu  nn[         R"                  " UUSS9u  nn[         R"                  " UUSS9u  nnUS-   nUS-   nUnUn UU-  UU -  -   n!SUU-
  -  n"UU"-  nUU"-  nUU-
  U-  n#UU-
  U-  n$UU-
  U#-  n%UU-
  U$-  n&[        R$                  " U%5      R'                  [
        5      n'[        R$                  " U&5      R'                  [
        5      n([        R(                  " U%5      R'                  [
        5      n)[        R(                  " U&5      R'                  [
        5      n*[        R*                  " SU':*  U'U:  -  SU(:*  -  U(U:  -  U'U-  U(-   S-   S5      n+[        R*                  " SU):*  U)U:  -  SU*:*  -  U*U :  -  U)U -  U*-   S-   S5      n,U%U'-
  S-  SU&U(-
  S-  -  -   n-U%U)-
  S-
  S-  SU&U*-
  S-
  S-  -  -   n.U-U.:  n/Uc  [        R,                  " U+U/   SUU-  -   S9SS
 n0[        R,                  " U,U/)    SUU -  -   S9SS
 n1[        R.                  " U0U1/5      R'                  [        5      n2Ub  [        R0                  U2U2U:  '   [        R2                  " [        U5      5      nGO[5        SUU-  -   5       V3s/ s H  n3/ PM     n4n3[5        SUU -  -   5       V3s/ s H  n3/ PM     n5n3[5        [        U5      5       HC  n6U/U6   (       a  U4U+U6      R7                  UU6   5        M)  U5U,U6      R7                  UU6   5        ME     Uc  Sn[        R8                  " U4U54 V7V8s/ s H7  n7U7SS
   H*  n8[        U85      U:  a  U" U85      O[        R0                  PM,     M9     sn8n7[        5      n2[        R:                  " U25      ) n9[        R<                  " U!S4[        5      n:[        R>                  " [        R@                  " U5      U5      U:S
UU-  2S4'   [        RB                  " [        R@                  " U5      U5      U:S
UU-  2S4'   [        R>                  " [        R@                  " U5      S-   U 5      U:UU-  S
2S4'   [        RB                  " [        R@                  " U 5      U5      S-   U:UU-  S
2S4'   U:S
S
2S4==   U#-  ss'   U:S
S
2S4==   U$-  ss'   U:S
S
2S4==   U-  ss'   U:S
S
2S4==   U-  ss'   U:U9S
S
24   n:U2U9   n2U#U$S-  /[        R8                  " SS/SS/SS/SS/SS/SS//5      -  n;Uc  [D        RF                  S   /nUS:X  d  US:X  a  [        RH                  " U;S5      n<US:X  a4  SU<S
S
2S
S
2S4   -  U<S
S
2S
S
2S4'   SU-  nSU-  nU RK                  U5        US:X  a4  SU<S
S
2S
S
2S4   -  U<S
S
2S
S
2S4'   SU-  nSU-  nU RM                  U5        OU;/n<[N        RP                  " U<UUU:[         RR                  " U RT                  5      S9n=[        RV                  " US5      (       a7  U
b  [X        RZ                  " SU< 35        O[\        R^                  " XS9n
S
=pS
nUb  [        R                  " U5      (       d=  [        U25      [        U25      n?n>US-  nU>U?U>-
  [        R@                  " U5      -  U-  -   n[        R`                  " U5      nURc                  U25      n2U(       a  U=Re                  UU	XUS9  O"U=Rg                  U	5        U=Ri                  U
5        U=Rk                  U25        U=Rm                  U5        U=Ro                  U5        U=Rq                  XU5        U
bH  U=Rr                  Rt                  c1  U=Rr                  Rv                  c  U=Rr                  Ry                  5         UU4UU44n@U R{                  U@5        U R}                  S S!9  U R                  U=SS"9  U(       d  U=$ / nASUUUUU4SUUUUSU-  44 GH  u  nBnCnDnEnFnGUFS:X  a  [        R                  " WDWEWGS-   5      nHO[        R                  " WDWEWGS-   5      nH[        R                  " WGS#S45      nIWHS
S$ =UIS
S
2SS4'   UIS
S
2SS4'   UHSS
 =UIS
S
2SS4'   UIS
S
2SS4'   S=UIS
S
2SS4'   UIS
S
2SS4'   S%=UIS
S
2SS4'   UIS
S
2SS4'   WBS:X  a  WIS
S
2S
S
2S
S
S$24   nI[        Rb                  " WHWC5      S-
  nJ[        R                  " WG5      nK[5        UG5       H5  n6UWJU6:H     nL[        UL5      S:  a  U" WL5      O[        R0                  WKU6'   M7     [        R:                  " WK5      ) nMWIUM   nIUKUM   nK[        U S&WB S'35      " S(S)9nN[N        RP                  " UIUNS*S+9nOUORk                  UK5        UORg                  U	5        UORi                  U
5        UORm                  U5        UORo                  U5        WAR7                  U R                  UOSS"95        GM     WAu  U=lD        U=lE        S, nPU=R                  R                  S-UP5        U=$ s  sn3f s  sn3f s  sn8n7f ).a  
Make a 2D hexagonal binning plot of points *x*, *y*.

If *C* is *None*, the value of the hexagon is determined by the number
of points in the hexagon. Otherwise, *C* specifies values at the
coordinate (x[i], y[i]). For each hexagon, these values are reduced
using *reduce_C_function*.

Parameters
----------
x, y : array-like
    The data positions. *x* and *y* must be of the same length.

C : array-like, optional
    If given, these values are accumulated in the bins. Otherwise,
    every point has a value of 1. Must be of the same length as *x*
    and *y*.

gridsize : int or (int, int), default: 100
    If a single int, the number of hexagons in the *x*-direction.
    The number of hexagons in the *y*-direction is chosen such that
    the hexagons are approximately regular.

    Alternatively, if a tuple (*nx*, *ny*), the number of hexagons
    in the *x*-direction and the *y*-direction. In the
    *y*-direction, counting is done along vertically aligned
    hexagons, not along the zig-zag chains of hexagons; see the
    following illustration.

    .. plot::

       import numpy
       import matplotlib.pyplot as plt

       np.random.seed(19680801)
       n= 300
       x = np.random.standard_normal(n)
       y = np.random.standard_normal(n)

       fig, ax = plt.subplots(figsize=(4, 4))
       h = ax.hexbin(x, y, gridsize=(5, 3))
       hx, hy = h.get_offsets().T
       ax.plot(hx[24::3], hy[24::3], 'ro-')
       ax.plot(hx[-3:], hy[-3:], 'ro-')
       ax.set_title('gridsize=(5, 3)')
       ax.axis('off')

    To get approximately regular hexagons, choose
    :math:`n_x = \sqrt{3}\,n_y`.

bins : 'log' or int or sequence, default: None
    Discretization of the hexagon values.

    - If *None*, no binning is applied; the color of each hexagon
      directly corresponds to its count value.
    - If 'log', use a logarithmic scale for the colormap.
      Internally, :math:`log_{10}(i+1)` is used to determine the
      hexagon color. This is equivalent to ``norm=LogNorm()``.
    - If an integer, divide the counts in the specified number
      of bins, and color the hexagons accordingly.
    - If a sequence of values, the values of the lower bound of
      the bins to be used.

xscale : {'linear', 'log'}, default: 'linear'
    Use a linear or log10 scale on the horizontal axis.

yscale : {'linear', 'log'}, default: 'linear'
    Use a linear or log10 scale on the vertical axis.

mincnt : int >= 0, default: *None*
    If not *None*, only display cells with at least *mincnt*
    number of points in the cell.

marginals : bool, default: *False*
    If marginals is *True*, plot the marginal density as
    colormapped rectangles along the bottom of the x-axis and
    left of the y-axis.

extent : 4-tuple of float, default: *None*
    The limits of the bins (xmin, xmax, ymin, ymax).
    The default assigns the limits based on
    *gridsize*, *x*, *y*, *xscale* and *yscale*.

    If *xscale* or *yscale* is set to 'log', the limits are
    expected to be the exponent for a power of 10. E.g. for
    x-limits of 1 and 50 in 'linear' scale and y-limits
    of 10 and 1000 in 'log' scale, enter (1, 50, 1, 3).

Returns
-------
`~matplotlib.collections.PolyCollection`
    A `.PolyCollection` defining the hexagonal bins.

    - `.PolyCollection.get_offsets` contains a Mx2 array containing
      the x, y positions of the M hexagon centers in data coordinates.
    - `.PolyCollection.get_array` contains the values of the M
      hexagons.

    If *marginals* is *True*, horizontal
    bar and vertical bar (both PolyCollections) will be attached
    to the return collection as attributes *hbar* and *vbar*.

Other Parameters
----------------
%(cmap_doc)s

%(norm_doc)s

%(vmin_vmax_doc)s

alpha : float between 0 and 1, optional
    The alpha blending value, between 0 (transparent) and 1 (opaque).

linewidths : float, default: *None*
    If *None*, defaults to :rc:`patch.linewidth`.

edgecolors : {'face', 'none', *None*} or color, default: 'face'
    The color of the hexagon edges. Possible values are:

    - 'face': Draw the edges in the same color as the fill color.
    - 'none': No edges are drawn. This can sometimes lead to unsightly
      unpainted pixels between the hexagons.
    - *None*: Draw outlines in the default color.
    - An explicit color.

reduce_C_function : callable, default: `numpy.mean`
    The function to aggregate *C* within the bins. It is ignored if
    *C* is not given. This must have the signature::

        def reduce_C_function(C: array) -> float

    Commonly used functions are:

    - `numpy.mean`: average of the points
    - `numpy.sum`: integral of the point values
    - `numpy.amax`: value taken from the largest point

    By default will only reduce cells with at least 1 point because some
    reduction functions (such as `numpy.amax`) will error/warn with empty
    input. Changing *mincnt* will adjust the cutoff, and if set to 0 will
    pass empty input to the reduction function.

%(colorizer_doc)s

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs : `~matplotlib.collections.PolyCollection` properties
    All other keyword arguments are passed on to `.PolyCollection`:

    %(PolyCollection:kwdoc)s

See Also
--------
hist2d : 2D histogram rectangular bins
r   r,   Fr  rD  ru          z7x contains non-positive values, so cannot be log-scaledz7y contains non-positive values, so cannot be log-scaledNz)In extent, xmax must be greater than xminz)In extent, ymax must be greater than yminr   r  r  )expanderr  g&.>r   r  g      @rq   )	minlength      r.   g      zpatch.linewidth      $@)r  r0  r  r  zGOnly one of 'bins' and 'norm' arguments can be supplied, ignoring bins=r  r  r  Ttightr
  r  r  r  get_axis_transformr   r   r  )r]   r  c                 L   U R                   R                  U R                  5       5        U R                   R                  U R                  5       5        U R                  R	                  U R                  5       5        U R                  R	                  U R                  5       5        g rZ   )hbarr  get_cmapvbarset_climget_clim)r  s    r   
on_changedAxes.hexbin.<locals>.on_changedU  sn    OO$$Z%8%8%:;OO$$Z%8%8%:;OO$$Z%8%8%:;OO$$Z%8%8%:;r   changed)Hr   r9   delete_masked_pointsr  r  intrv  r  rA  r<   r=  r   log10r   rH  rI  r   nonsingularroundr  floorr  bincountconcatenatenanonesre  r   r6  r  r  r  r  rD  r6   r7   expand_dimsrw  rx  r  r5  AffineDeltaTransformrx   
_str_equalr   r  rB  LogNormsortsearchsortedr  r  r  r  	set_alphar?   r  r  r  r  	autoscaler   r   r  	geomspacelinspacer  rl  r  r  	callbacksconnect)Qr(   r   r,   r  r  binsxscaleyscaleextentr  r  r  r  rt   r0  r  reduce_C_functionmincnt	marginalsr  rC   nxnytxtyr   r   r   r   nx1ny1nx2ny2nr  r  syr   r   ix1iy1ix2iy2i1i2d1d2bdistcounts1counts2accumr  Cs_at_i1Cs_at_i2iCs_at_iacc	good_idxsr  polygonpolygonsr  minimummaximumr&  r   znamezzminzmaxzscalenbins	bin_edgesvertsbin_idxsvaluesr'  r  r   r  r  sQ                                                                                    r   hexbinAxes.hexbin  s   J 	#qC8 4feL,,Q15a ;;x  FBBR$))A,&'BJJq% JJq%  U?vva3h MO O"BU?vva3h MO O"B%+"D$dd{ !LMMd{ !LMM  25Q"&&(BFFH-VJD$14Q"&&(BFFH-VJD$ %00tcJJD$$00tcJJD$1f1f#Ic	! 4$;'TkRTkR4i24i2hhrl!!#&hhrl!!#&hhrl!!#&hhrl!!#&XXqCxC#I.!s(;sSyICi#o)1.XXqCxC#I.!s(;sSyICi#o)1. 3h1_sb3h1_443hn"SBHsNq+@%@@b9kk"U)q39}EabIGkk"eV*C#IFqrJGNNGW#56==eDE!(*efn%AA %*!cCi-$89$8q$8H9$)!cCi-$89$8q$8H93q6]8RUO**1Q40RUO**1Q40	 #
 ~HH!)8 4) 4W#ABKS ,/s8v+="3'266I' J 4) 	E XXe_$	((Aq65)!#299S>3!?
s
A!#3!=
s
A!#299S>C+?!Ec	
A!#3!=!Cc	
A1111)Q,'i rAv,#YR2r(S"ISzB9M"O O ,,'89:JU?fo~~gq1H$(HQ1W,=$=Aq!t|t|'$(HQ1W,=$=Aq!t|t|'yH))!!(==dnnM

 D%(("" $F@Dw$H I D<""D;;t$$#&u:s5z	'G"3ryy!F!MM774=D%%e,E44YT:>:> 5 @ %%U#U###F+t40 ##+
0D0D0L))+$<$.G$$$4$0 	J6 atVR0atVQV44
/E1dD&%
 LLtUQY?	KKdEAI>	HHeQ]+E.7n<E!Q'NU1a7^.7m;E!Q'NU1a7^.11E!Q'NU1a7^.11E!Q'NU1a7^|aDbDj) y!4q8HXXe_F5\ x1}%58Wq[-b1bffq		 " HHV$$D$KED\FDD~">?fME&&6;CMM&!LLLLMM%   (KK++C+?@O4
R ,0(
	< 	$$Y
;y :9)s   o$1o)6>o.
c                     U R                  U5      nU R                  U5      nU R                  U5      nU R                  U5      n[        R                  " XX440 UD6nU R	                  U5        U R                  5         U$ )a  
[*Discouraged*] Add an arrow to the Axes.

This draws an arrow from ``(x, y)`` to ``(x+dx, y+dy)``.

.. admonition:: Discouraged

    The use of this method is discouraged because it is not guaranteed
    that the arrow renders reasonably. For example, the resulting arrow
    is affected by the Axes aspect ratio and limits, which may distort
    the arrow.

    Consider using `~.Axes.annotate` without a text instead, e.g. ::

        ax.annotate("", xytext=(0, 0), xy=(0.5, 0.5),
                    arrowprops=dict(arrowstyle="->"))

Parameters
----------
%(FancyArrow)s

Returns
-------
`.FancyArrow`
    The created `.FancyArrow` object.
)r  r  r   
FancyArrowr   r   )r(   r   r,   r{  r|  rC   r   s          r   arrow
Axes.arrow_  sx    < ""  $  $b77q$$&r   c                 Z    [         R                  " XX4U40 UD6nU R                  U5        U$ rZ   )mquiver	QuiverKeyr{   )r(   QXYUr@   rC   qks           r   	quiverkeyAxes.quiverkey  s,    qQ5;F;	r   c                 x    [        U5      S:  a*  USS u  p4U R                  SU4SU4/U5      u  p4X44USS  -   $ U$ )NrD  r   r  r   r,   )r   r   )r(   rV   rC   r   r,   s        r   _quiver_unitsAxes._quiver_units  sS    t9q=!9DA**S!HsAh+?HDA6DH$$r   c                     U R                  X5      n[        R                  " U /UQ70 UD6nU R                  USS9  U R	                  5         U$ )z%(quiver_doc)sTr
  )rI  r?  Quiverr  r   )r(   rV   rC   qs       r   quiverAxes.quiver  sP    
 !!$/NN41$1&1At,$$&r   c                     U R                  X5      n[        R                  " U /UQ70 UD6nU R                  USS9  U R	                  5         U$ )z%(barbs_doc)sTr
  )rI  r?  Barbsr  r   )r(   rV   rC   r  s       r   barbs
Axes.barbs  sP    
 !!$/MM$000At,$$&r   )rX  c                    [         R                  " U[        R                  5      n/ U R                  " U /UQ7SU0UD6QnU H  nU R                  U5        M     U R                  5         U$ )a  
Plot filled polygons.

Parameters
----------
*args : sequence of x, y, [color]
    Each polygon is defined by the lists of *x* and *y* positions of
    its nodes, optionally followed by a *color* specifier. See
    :mod:`matplotlib.colors` for supported color specifiers. The
    standard color cycle is used for polygons without a color
    specifier.

    You can plot multiple polygons by providing multiple *x*, *y*,
    *[color]* groups.

    For example, each of the following is legal::

        ax.fill(x, y)                    # a polygon with default color
        ax.fill(x, y, "b")               # a blue polygon
        ax.fill(x, y, x2, y2)            # two polygons
        ax.fill(x, y, "b", x2, y2, "r")  # a blue and a red polygon

data : indexable object, optional
    An object with labelled data. If given, provide the label names to
    plot in *x* and *y*, e.g.::

        ax.fill("time", "signal",
                data={"time": [0, 1, 2], "signal": [0, 1, 0]})

Returns
-------
list of `~matplotlib.patches.Polygon`

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

Notes
-----
Use :meth:`fill_between` if you would like to fill the region between
two curves.
rX  )r9   rZ  r   r   r  r   r   )r(   rX  rV   rC   r  polys         r   fill	Axes.fill  sf    X ''>QD..tPdPPPQDNN4  $$&r   r  interpolater  c                  ^ [         R                  R                  U5      n	[        R                  S   (       d\  [
        R                  " T[         R                  5      m[        U4S jS 5       5      (       d  U R                  R                  5       TS'   U R                  " XX#U40 TD6u  p#n[         R                  " XX44XVUS.TD6n
U R                  U
5        U R                  5         U
$ )a  
Fill the area between two {dir} curves.

The curves are defined by the points (*{ind}*, *{dep}1*) and (*{ind}*,
*{dep}2*).  This creates one or multiple polygons describing the filled
area.

You may exclude some {dir} sections from filling using *where*.

By default, the edges connect the given points directly.  Use *step*
if the filling should be a step function, i.e. constant in between
*{ind}*.

Parameters
----------
{ind} : array-like
    The {ind} coordinates of the nodes defining the curves.

{dep}1 : array-like or float
    The {dep} coordinates of the nodes defining the first curve.

{dep}2 : array-like or float, default: 0
    The {dep} coordinates of the nodes defining the second curve.

where : array-like of bool, optional
    Define *where* to exclude some {dir} regions from being filled.
    The filled regions are defined by the coordinates ``{ind}[where]``.
    More precisely, fill between ``{ind}[i]`` and ``{ind}[i+1]`` if
    ``where[i] and where[i+1]``.  Note that this definition implies
    that an isolated *True* value between two *False* values in *where*
    will not result in filling.  Both sides of the *True* position
    remain unfilled due to the adjacent *False* values.

interpolate : bool, default: False
    This option is only relevant if *where* is used and the two curves
    are crossing each other.

    Semantically, *where* is often used for *{dep}1* > *{dep}2* or
    similar.  By default, the nodes of the polygon defining the filled
    region will only be placed at the positions in the *{ind}* array.
    Such a polygon cannot describe the above semantics close to the
    intersection.  The {ind}-sections containing the intersection are
    simply clipped.

    Setting *interpolate* to *True* will calculate the actual
    intersection point and extend the filled region up to this point.

step : {{'pre', 'post', 'mid'}}, optional
    Define *step* if the filling should be a step function,
    i.e. constant in between *{ind}*.  The value determines where the
    step will occur:

    - 'pre': The {dep} value is continued constantly to the left from
      every *{ind}* position, i.e. the interval ``({ind}[i-1], {ind}[i]]``
      has the value ``{dep}[i]``.
    - 'post': The y value is continued constantly to the right from
      every *{ind}* position, i.e. the interval ``[{ind}[i], {ind}[i+1])``
      has the value ``{dep}[i]``.
    - 'mid': Steps occur half-way between the *{ind}* positions.

Returns
-------
`.FillBetweenPolyCollection`
    A `.FillBetweenPolyCollection` containing the plotted polygons.

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    All other keyword arguments are passed on to
    `.FillBetweenPolyCollection`. They control the `.Polygon` properties:

    %(FillBetweenPolyCollection:kwdoc)s

See Also
--------
fill_between : Fill between two sets of y-values.
fill_betweenx : Fill between two sets of x-values.
rG  c              3   ,   >#    U  H	  oT;   v   M     g 7frZ   rb   )r4  r  rC   s     r   r6  ,Axes._fill_between_x_or_y.<locals>.<genexpr>?  s     C,BqF{,Bs   )r5   rr   rr   rX  )r  FillBetweenPolyCollection_f_dir_from_tr6   r7   r9   rZ  r  r=  r  r  _fill_between_process_unitsr  r   )r(   ind_dirinddep1dep2r  rY  r  rC   dep_dirr  s           `  r   _fill_between_x_or_yAxes._fill_between_x_or_y  s    p 11??H||45++FE4D4DEFC,BCCC&*&@&@&O&O&Q{#::c91794 44$GtG?EG
 	J'$$&r   c           	      v    [        [        R                  R                  U R	                  X4X$4X%4/U5      5      $ )z"Handle united data, such as dates.)mapr  r  r  r   )r(   r`  rd  ra  rb  rc  rC   s          r   r_   Axes._fill_between_process_unitsM  s=    255'')@)@^g_wo>*H I 	Ir   c                 2    U R                   " SXU4XEUS.UD6$ )Nr   rX  re  )r(   r   r'  y2r  rY  r  rC   s           r   fill_betweenAxes.fill_betweenR  2    ((GtG?EG 	Gr   )dirra  r  )r   r'  rl  r  c                 2    U R                   " SXU4XFUS.UD6$ )Nr,   rX  rk  )r(   r,   r&  x2r  r  rY  rC   s           r   fill_betweenxAxes.fill_betweenx`  ro  r   )r,   r&  rr  r  g      @)aspectinterpolationrt   r  r  r  originr
  interpolation_stage
filternorm	filterradresampleurlc                ~   [         R                  " U 4X#U	XZXXUS.
UD6nUcV  UR                  5       (       a.  UR                  5       R	                  U R
                  5      (       a  [        R                  S   nUb  U R                  U5        UR                  U5        UR                  U5        UR                  5       c  UR                  U R                  5        UR                  XUS9  UR                  X7U5        UR!                  U5        UR#                  UR%                  5       5        U R'                  U5        U$ )a   
Display data as an image, i.e., on a 2D regular raster.

The input may either be actual RGB(A) data, or 2D scalar data, which
will be rendered as a pseudocolor image. For displaying a grayscale
image, set up the colormapping using the parameters
``cmap='gray', vmin=0, vmax=255``.

The number of pixels used to render an image is set by the Axes size
and the figure *dpi*. This can lead to aliasing artifacts when
the image is resampled, because the displayed image size will usually
not match the size of *X* (see
:doc:`/gallery/images_contours_and_fields/image_antialiasing`).
The resampling can be controlled via the *interpolation* parameter
and/or :rc:`image.interpolation`.

Parameters
----------
X : array-like or PIL image
    The image data. Supported array shapes are:

    - (M, N): an image with scalar data. The values are mapped to
      colors using normalization and a colormap. See parameters *norm*,
      *cmap*, *vmin*, *vmax*.
    - (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
    - (M, N, 4): an image with RGBA values (0-1 float or 0-255 int),
      i.e. including transparency.

    The first two dimensions (M, N) define the rows and columns of
    the image.

    Out-of-range RGB(A) values are clipped.

%(cmap_doc)s

    This parameter is ignored if *X* is RGB(A).

%(norm_doc)s

    This parameter is ignored if *X* is RGB(A).

%(vmin_vmax_doc)s

    This parameter is ignored if *X* is RGB(A).

%(colorizer_doc)s

    This parameter is ignored if *X* is RGB(A).

aspect : {'equal', 'auto'} or float or None, default: None
    The aspect ratio of the Axes.  This parameter is particularly
    relevant for images since it determines whether data pixels are
    square.

    This parameter is a shortcut for explicitly calling
    `.Axes.set_aspect`. See there for further details.

    - 'equal': Ensures an aspect ratio of 1. Pixels will be square
      (unless pixel sizes are explicitly made non-square in data
      coordinates using *extent*).
    - 'auto': The Axes is kept fixed and the aspect is adjusted so
      that the data fit in the Axes. In general, this will result in
      non-square pixels.

    Normally, None (the default) means to use :rc:`image.aspect`.  However, if
    the image uses a transform that does not contain the axes data transform,
    then None means to not modify the axes aspect at all (in that case, directly
    call `.Axes.set_aspect` if desired).

interpolation : str, default: :rc:`image.interpolation`
    The interpolation method used.

    Supported values are 'none', 'auto', 'nearest', 'bilinear',
    'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite',
    'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell',
    'sinc', 'lanczos', 'blackman'.

    The data *X* is resampled to the pixel size of the image on the
    figure canvas, using the interpolation method to either up- or
    downsample the data.

    If *interpolation* is 'none', then for the ps, pdf, and svg
    backends no down- or upsampling occurs, and the image data is
    passed to the backend as a native image.  Note that different ps,
    pdf, and svg viewers may display these raw pixels differently. On
    other backends, 'none' is the same as 'nearest'.

    If *interpolation* is the default 'auto', then 'nearest'
    interpolation is used if the image is upsampled by more than a
    factor of three (i.e. the number of display pixels is at least
    three times the size of the data array).  If the upsampling rate is
    smaller than 3, or the image is downsampled, then 'hanning'
    interpolation is used to act as an anti-aliasing filter, unless the
    image happens to be upsampled by exactly a factor of two or one.

    See
    :doc:`/gallery/images_contours_and_fields/interpolation_methods`
    for an overview of the supported interpolation methods, and
    :doc:`/gallery/images_contours_and_fields/image_antialiasing` for
    a discussion of image antialiasing.

    Some interpolation methods require an additional radius parameter,
    which can be set by *filterrad*. Additionally, the antigrain image
    resize filter is controlled by the parameter *filternorm*.

interpolation_stage : {'auto', 'data', 'rgba'}, default: 'auto'
    Supported values:

    - 'data': Interpolation is carried out on the data provided by the user
      This is useful if interpolating between pixels during upsampling.
    - 'rgba': The interpolation is carried out in RGBA-space after the
      color-mapping has been applied. This is useful if downsampling and
      combining pixels visually.
    - 'auto': Select a suitable interpolation stage automatically. This uses
      'rgba' when downsampling, or upsampling at a rate less than 3, and
      'data' when upsampling at a higher rate.

    See :doc:`/gallery/images_contours_and_fields/image_antialiasing` for
    a discussion of image antialiasing.

alpha : float or array-like, optional
    The alpha blending value, between 0 (transparent) and 1 (opaque).
    If *alpha* is an array, the alpha blending values are applied pixel
    by pixel, and *alpha* must have the same shape as *X*.

origin : {'upper', 'lower'}, default: :rc:`image.origin`
    Place the [0, 0] index of the array in the upper left or lower
    left corner of the Axes. The convention (the default) 'upper' is
    typically used for matrices and images.

    Note that the vertical axis points upward for 'lower'
    but downward for 'upper'.

    See the :ref:`imshow_extent` tutorial for
    examples and a more detailed description.

extent : floats (left, right, bottom, top), optional
    The bounding box in data coordinates that the image will fill.
    These values may be unitful and match the units of the Axes.
    The image is stretched individually along x and y to fill the box.

    The default extent is determined by the following conditions.
    Pixels have unit size in data coordinates. Their centers are on
    integer coordinates, and their center coordinates range from 0 to
    columns-1 horizontally and from 0 to rows-1 vertically.

    Note that the direction of the vertical axis and thus the default
    values for top and bottom depend on *origin*:

    - For ``origin == 'upper'`` the default is
      ``(-0.5, numcols-0.5, numrows-0.5, -0.5)``.
    - For ``origin == 'lower'`` the default is
      ``(-0.5, numcols-0.5, -0.5, numrows-0.5)``.

    See the :ref:`imshow_extent` tutorial for
    examples and a more detailed description.

filternorm : bool, default: True
    A parameter for the antigrain image resize filter (see the
    antigrain documentation).  If *filternorm* is set, the filter
    normalizes integer values and corrects the rounding errors. It
    doesn't do anything with the source floating point values, it
    corrects only integers according to the rule of 1.0 which means
    that any sum of pixel weights must be equal to 1.0.  So, the
    filter function must produce a graph of the proper shape.

filterrad : float > 0, default: 4.0
    The filter radius for filters that have a radius parameter, i.e.
    when interpolation is one of: 'sinc', 'lanczos' or 'blackman'.

resample : bool, default: :rc:`image.resample`
    When *True*, use a full resampling method.  When *False*, only
    resample when the output image is larger than the input image.

url : str, optional
    Set the url of the created `.AxesImage`. See `.Artist.set_url`.

Returns
-------
`~matplotlib.image.AxesImage`

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs : `~matplotlib.artist.Artist` properties
    These parameters are passed on to the constructor of the
    `.AxesImage` artist.

See Also
--------
matshow : Plot a matrix or an array as an image.

Notes
-----
Unless *extent* is used, pixel centers will be located at integer
coordinates. In other words: the origin will coincide with the center
of pixel (0, 0).

There are two common representations for RGB images with an alpha
channel:

-   Straight (unassociated) alpha: R, G, and B channels represent the
    color of the pixel, disregarding its opacity.
-   Premultiplied (associated) alpha: R, G, and B channels represent
    the color of the pixel, adjusted for its opacity by multiplication.

`~matplotlib.pyplot.imshow` expects RGB images adopting the straight
(unassociated) alpha representation.
)
r  r  r  rv  rw  r
  ry  rz  r{  rx  zimage.aspectr  )mimage	AxesImageis_transform_setr  contains_branchrx   r6   r7   rp  set_datar  r   r   r   _check_exclusionary_keywordsr  set_url
set_extent
get_extent	add_image)r(   rB  r  r  ru  rv  rt   r  r  r  rw  r
  rx  ry  rz  r{  r|  rC   ims                      r   imshowAxes.imshowp  s   t d (I,9%+(12E	(
 !'( >##%%((*::4>>JJ\\.1FOOF#
A
U%TZZ(
''	4'H
t4(


3 	bmmo&r	r   r4   shadingc                f  ^ / SQn [         R                  " XRS9  [	        U5      S:X  a  [
        R                  " US   5      nUR                  S S	 u  pxUS
;   aC  [
        R                  " [
        R                  " U5      [
        R                  " U5      5      u  pGO)[
        R                  " [
        R                  " US-   5      [
        R                  " US-   5      5      u  pSnO[	        U5      S:X  a  [
        R                  " US	   5      nUS S	 u  pU R                  SU	4SU
4/U5      u  pS X4 5       u  pTS:X  aS  [
        R                  R                  U	5      (       d$  [
        R                  R                  U
5      (       a  [        S5      eUR                  S S	 u  pxO[         R                  " TS[	        U5      S9eU	R                  S   nU
R                  S   nU	R                  S	:w  d  U	R                  S   S:X  a"  U	R                  SU5      nUR!                  USS9n	U
R                  S	:w  d  U
R                  S   S:X  a"  U
R                  US5      nUR!                  USS9n
U	R                  U
R                  :w  a  [#        ST ST S35      eUS:X  a  X:X  a  X|:X  a  SnOSnUS:X  a2  X4US-   US-   4:w  a"  [#        SUR                   SU SU ST S3	5      eOX4X4:w  a  [#        SUR                  XT4-  5      eUS:X  aZ  S#U4S jjnX:X  a  U" U	S S!9n	U" U
5      n
X|:X  a7  U" U	R$                  5      R$                  n	U" U
R$                  S S!9R$                  n
Sn[&        R(                  " US S"9nXXb4$ ! [         a#    [         R                  " SU SU S35        Sn GNf = f)$N)gouraudnearestflatr4   r  zshading value 'z' not in list of valid values z. Setting shading='auto'.r4   r  r   r  )r  r  r  rD  r   r,   c              3   L   #    U  H  n[         R                  " US S9v   M     g7f)Tr   N)r9   safe_masked_invalid)r4  r   s     r   r6  #Axes._pcolorargs.<locals>.<genexpr>  s     LVE--ad;Vs   "$
pcolormeshzsx and y arguments to pcolormesh cannot have non-finite values or be of type numpy.ma.MaskedArray with masked values1 or 3)takesgivenr  r   zIncompatible X, Y inputs to z; see help(r  r  zDimensions of C z should be one smaller than X(z) and Y(z&) while using shading='flat' see help(zKDimensions of C %s are incompatible with X (%d) and/or Y (%d); see help(%s)c                 |  > [         R                  " U 5      S   S:  Ga  [         R                  " U SS9S-  nU(       aY  [         R                  " US:  5      (       d;  [         R                  " US:*  5      (       d  [        R
                  " ST ST S35        [         R                  R                  U 5      (       a  [         R                  R                  O[         R                  nU" U S S 2S/4   US S 2S/4   -
  U S S 2S S24   U-   U S S 2S/4   US S 2S/4   -   45      n U $ [         R                  " X 45      n U $ )	Nr  r  rq   r   zThe input coordinates to z are interpreted as cell centers, but are not monotonically increasing or decreasing. This may lead to incorrectly calculated cell edges, in which case, please supply explicit cell edges to r/  r  )	r  r  diffrg  r   r  r  isMAhstack)rB  require_monotonicitydXr  funcnames       r   _interp_grid&Axes._pcolorargs.<locals>._interp_grid  s   
 xx{1~)WWQQ/#50%'VVB!G__rQw ..";H: F:
 ;C1!FG 24ABII"Aa!fI1qc6
$:$%a"fIN$%a"gJAtG$<$> ? H IIqf-Hr   T)r  r  )F)r   r  r   r  r   r  r>  r  meshgridr  r   r  r  rH  rr  reshaper  r   Tr9   r  )r(   r  r  rV   rC   _valid_shadingr  nrowsncolsrB  rC  r  Nyr   r,   r  s    `              r   _pcolorargsAxes._pcolorargsh  s    @	~? t9>d1g&A772A;LE00{{299U#3RYYu5EF1{{299UQY#75199MN Y!^d1g&A8DA**S!HsAh+?HDALaVLDA<'55??1%%););$BC C 772A;LE5""883t9MMWWR[WWQZ66Q;!''!*/		!R A!$A66Q;!''!*/		"a A!$A77agg:8* E((0z4 5 5 f{u{# fxEAIuqy11"2177) <::<XbT J--5Ja!9 : : 2 xE>) !F$%GGRXI?!? @ @ )#6 ;$QTBA$QA;$QSS)++A$QSStDFFA %%ad3QK  		 ://=.> ?1 1 2 G		s   N )N0/N0)r  rt   r  r  r  r  r  c          	      n   Uc  [         R                  S   nUR                  5       nU R                  " S/UQ7UU	S.6u  ppSnSU	;   a  U	R	                  S5      U	S'   U	R                  SU5        SU	;   a  U	R	                  S5      U	S	'   U	R                  S	S
5      nSU	;   a  U	R	                  S5      U	S'   SU	;  a!  [        R                  " US
5      (       a  SU	S'   U	R                  SS5        [        R                  R                  U
5      (       d$  [        R                  R                  U5      (       ay  [        R                  R                  n[        R                  R                  U
5      n
[        R                  R                  U5      nU
R                  5       nUR                  5       nO[        R                  nU
nUnU" X/SS9n[        R                  " U4XX7US.U	D6nUR!                  XuUS9  UR#                  X5U5        UR$                  n['        U[(        R*                  5      (       d,  [-        US5      (       a  UR/                  U R0                  5      nU(       a  [3        UR5                  U R6                  5      5      (       a_  UU R6                  -
  n[        R8                  " UU/5      R:                  R=                  [>        5      nURA                  U5      nUS   nUS   nU RC                  USS9  [        RD                  " U5      n[        RF                  " U5      n[        RD                  " U5      n[        RF                  " U5      nUU/URH                  RJ                  SS& UU/URH                  RL                  SS& UU4UU44nU RO                  U5        U RQ                  5         U$ )u  
Create a pseudocolor plot with a non-regular rectangular grid.

Call signature::

    pcolor([X, Y,] C, /, **kwargs)

*X* and *Y* can be used to specify the corners of the quadrilaterals.

The arguments *X*, *Y*, *C* are positional-only.

.. hint::

    ``pcolor()`` can be very slow for large arrays. In most
    cases you should use the similar but much faster
    `~.Axes.pcolormesh` instead. See
    :ref:`Differences between pcolor() and pcolormesh()
    <differences-pcolor-pcolormesh>` for a discussion of the
    differences.

Parameters
----------
C : 2D array-like
    The color-mapped values.  Color-mapping is controlled by *cmap*,
    *norm*, *vmin*, and *vmax*.

X, Y : array-like, optional
    The coordinates of the corners of quadrilaterals of a pcolormesh::

        (X[i+1, j], Y[i+1, j])       (X[i+1, j+1], Y[i+1, j+1])
                              ●╶───╴●
                              │     │
                              ●╶───╴●
            (X[i, j], Y[i, j])       (X[i, j+1], Y[i, j+1])

    Note that the column index corresponds to the x-coordinate, and
    the row index corresponds to y. For details, see the
    :ref:`Notes <axes-pcolormesh-grid-orientation>` section below.

    If ``shading='flat'`` the dimensions of *X* and *Y* should be one
    greater than those of *C*, and the quadrilateral is colored due
    to the value at ``C[i, j]``.  If *X*, *Y* and *C* have equal
    dimensions, a warning will be raised and the last row and column
    of *C* will be ignored.

    If ``shading='nearest'``, the dimensions of *X* and *Y* should be
    the same as those of *C* (if not, a ValueError will be raised). The
    color ``C[i, j]`` will be centered on ``(X[i, j], Y[i, j])``.

    If *X* and/or *Y* are 1-D arrays or column vectors they will be
    expanded as needed into the appropriate 2D arrays, making a
    rectangular grid.

shading : {'flat', 'nearest', 'auto'}, default: :rc:`pcolor.shading`
    The fill style for the quadrilateral. Possible values:

    - 'flat': A solid color is used for each quad. The color of the
      quad (i, j), (i+1, j), (i, j+1), (i+1, j+1) is given by
      ``C[i, j]``. The dimensions of *X* and *Y* should be
      one greater than those of *C*; if they are the same as *C*,
      then a deprecation warning is raised, and the last row
      and column of *C* are dropped.
    - 'nearest': Each grid point will have a color centered on it,
      extending halfway between the adjacent grid centers.  The
      dimensions of *X* and *Y* must be the same as *C*.
    - 'auto': Choose 'flat' if dimensions of *X* and *Y* are one
      larger than *C*.  Choose 'nearest' if dimensions are the same.

    See :doc:`/gallery/images_contours_and_fields/pcolormesh_grids`
    for more description.

%(cmap_doc)s

%(norm_doc)s

%(vmin_vmax_doc)s

%(colorizer_doc)s

edgecolors : {'none', None, 'face', color, color sequence}, optional
    The color of the edges. Defaults to 'none'. Possible values:

    - 'none' or '': No edge.
    - *None*: :rc:`patch.edgecolor` will be used. Note that currently
      :rc:`patch.force_edgecolor` has to be True for this to work.
    - 'face': Use the adjacent face color.
    - A color or sequence of colors will set the edge color.

    The singular form *edgecolor* works as an alias.

alpha : float, default: None
    The alpha blending value of the face color, between 0 (transparent)
    and 1 (opaque). Note: The edgecolor is currently not affected by
    this.

snap : bool, default: False
    Whether to snap the mesh to pixel boundaries.

Returns
-------
`matplotlib.collections.PolyQuadMesh`

Other Parameters
----------------
antialiaseds : bool, default: False
    The default *antialiaseds* is False if the default
    *edgecolors*\ ="none" is used.  This eliminates artificial lines
    at patch boundaries, and works regardless of the value of alpha.
    If *edgecolors* is not "none", then the default *antialiaseds*
    is taken from :rc:`patch.antialiased`.
    Stroking the edges may be preferred if *alpha* is 1, but will
    cause artifacts otherwise.

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Additionally, the following arguments are allowed. They are passed
    along to the `~matplotlib.collections.PolyQuadMesh` constructor:

%(PolyCollection:kwdoc)s

See Also
--------
pcolormesh : for an explanation of the differences between
    pcolor and pcolormesh.
imshow : If *X* and *Y* are each equidistant, `~.Axes.imshow` can be a
    faster alternative.

Notes
-----
**Masked arrays**

*X*, *Y* and *C* may be masked arrays. If either ``C[i, j]``, or one
of the vertices surrounding ``C[i, j]`` (*X* or *Y* at
``[i, j], [i+1, j], [i, j+1], [i+1, j+1]``) is masked, nothing is
plotted.

.. _axes-pcolor-grid-orientation:

**Grid orientation**

The grid orientation follows the standard matrix convention: An array
*C* with shape (nrows, ncolumns) is plotted with the column number as
*X* and the row number as *Y*.
Npcolor.shadingpcolorr  rC   )r\  r8  r0  rs   r  rp   antialiasedsantialiasedFsnapr  r  )r6  r  r  r  rt   r  _as_mpl_transformr  r  r
  ))r6   r7   r&   r  r  rd   r9   r:   r  r  isMaskedArraystackrA  
compressedr  PolyQuadMeshr  r  
_transformr   r   	Transformr@  r  axesr=  r  rx   r  r  r  r<   r]   r  rH  rI  r  r   r,   r   r   )r(   r  rt   r  r  r  r  r  rV   rC   rB  rC  r  r0  ecr  r   r,   coordsr  r   trans_to_dataptstransformed_ptsr"  r#  r$  r%  r&  s                                r   r  Axes.pcolor  s8   n ?ll#34G--/++H ;t ;W39;a
& #)::k#:F< ,
3& #)::k#:F< |V4 V#$*JJ~$>F=!&5+A+A"f+M+M$)F=!&%(55q!!RUU%8%8%;%;EEKKEa Aa AAAHHEAAvB'''#T#!#
 	//	4/Pt40 !!1k3344.//##DII.AQ11$..ABB.M))QF#%%,,U3C+55c:O'A'AJ6vvayvvayvvayvvay(,d|
!!!$(,d|
!!!$,t,G$$$&r   )rt   r  r  r  r  r  r  r  c                F   Uc  [         R                  S   nUR                  5       nU
R                  SS5        U R                  " S/U	Q7XzS.6u  pp[
        R                  " X/SS9nU
R                  S	[         R                  S
   5        [        R                  " U4XXX&US.U
D6nUR                  XdUS9  UR                  X$U5        UR                  SS5      nUR                  n[        U[        R                  5      (       d,  [!        US5      (       a  UR#                  U R$                  5      nU(       aI  ['        UR)                  U R*                  5      5      (       a   UU R*                  -
  nUR-                  U5      nU R/                  USS9  [
        R0                  " USS9u  nn[
        R2                  " USS9u  nnUU/UR4                  R6                  SS& UU/UR4                  R8                  SS& UU4UU44nU R;                  U5        U R=                  5         U$ )u  
Create a pseudocolor plot with a non-regular rectangular grid.

Call signature::

    pcolormesh([X, Y,] C, /, **kwargs)

*X* and *Y* can be used to specify the corners of the quadrilaterals.

The arguments *X*, *Y*, *C* are positional-only.

.. hint::

   `~.Axes.pcolormesh` is similar to `~.Axes.pcolor`. It is much faster
   and preferred in most cases. For a detailed discussion on the
   differences see :ref:`Differences between pcolor() and pcolormesh()
   <differences-pcolor-pcolormesh>`.

Parameters
----------
C : array-like
    The mesh data. Supported array shapes are:

    - (M, N) or M*N: a mesh with scalar data. The values are mapped to
      colors using normalization and a colormap. See parameters *norm*,
      *cmap*, *vmin*, *vmax*.
    - (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
    - (M, N, 4): an image with RGBA values (0-1 float or 0-255 int),
      i.e. including transparency.

    The first two dimensions (M, N) define the rows and columns of
    the mesh data.

X, Y : array-like, optional
    The coordinates of the corners of quadrilaterals of a pcolormesh::

        (X[i+1, j], Y[i+1, j])       (X[i+1, j+1], Y[i+1, j+1])
                              ●╶───╴●
                              │     │
                              ●╶───╴●
            (X[i, j], Y[i, j])       (X[i, j+1], Y[i, j+1])

    Note that the column index corresponds to the x-coordinate, and
    the row index corresponds to y. For details, see the
    :ref:`Notes <axes-pcolormesh-grid-orientation>` section below.

    If ``shading='flat'`` the dimensions of *X* and *Y* should be one
    greater than those of *C*, and the quadrilateral is colored due
    to the value at ``C[i, j]``.  If *X*, *Y* and *C* have equal
    dimensions, a warning will be raised and the last row and column
    of *C* will be ignored.

    If ``shading='nearest'`` or ``'gouraud'``, the dimensions of *X*
    and *Y* should be the same as those of *C* (if not, a ValueError
    will be raised).  For ``'nearest'`` the color ``C[i, j]`` is
    centered on ``(X[i, j], Y[i, j])``.  For ``'gouraud'``, a smooth
    interpolation is carried out between the quadrilateral corners.

    If *X* and/or *Y* are 1-D arrays or column vectors they will be
    expanded as needed into the appropriate 2D arrays, making a
    rectangular grid.

%(cmap_doc)s

%(norm_doc)s

%(vmin_vmax_doc)s

%(colorizer_doc)s

edgecolors : {'none', None, 'face', color, color sequence}, optional
    The color of the edges. Defaults to 'none'. Possible values:

    - 'none' or '': No edge.
    - *None*: :rc:`patch.edgecolor` will be used. Note that currently
      :rc:`patch.force_edgecolor` has to be True for this to work.
    - 'face': Use the adjacent face color.
    - A color or sequence of colors will set the edge color.

    The singular form *edgecolor* works as an alias.

alpha : float, default: None
    The alpha blending value, between 0 (transparent) and 1 (opaque).

shading : {'flat', 'nearest', 'gouraud', 'auto'}, optional
    The fill style for the quadrilateral; defaults to
    :rc:`pcolor.shading`. Possible values:

    - 'flat': A solid color is used for each quad. The color of the
      quad (i, j), (i+1, j), (i, j+1), (i+1, j+1) is given by
      ``C[i, j]``. The dimensions of *X* and *Y* should be
      one greater than those of *C*; if they are the same as *C*,
      then a deprecation warning is raised, and the last row
      and column of *C* are dropped.
    - 'nearest': Each grid point will have a color centered on it,
      extending halfway between the adjacent grid centers.  The
      dimensions of *X* and *Y* must be the same as *C*.
    - 'gouraud': Each quad will be Gouraud shaded: The color of the
      corners (i', j') are given by ``C[i', j']``. The color values of
      the area in between is interpolated from the corner values.
      The dimensions of *X* and *Y* must be the same as *C*. When
      Gouraud shading is used, *edgecolors* is ignored.
    - 'auto': Choose 'flat' if dimensions of *X* and *Y* are one
      larger than *C*.  Choose 'nearest' if dimensions are the same.

    See :doc:`/gallery/images_contours_and_fields/pcolormesh_grids`
    for more description.

snap : bool, default: False
    Whether to snap the mesh to pixel boundaries.

rasterized : bool, optional
    Rasterize the pcolormesh when drawing vector graphics.  This can
    speed up rendering and produce smaller files for large data sets.
    See also :doc:`/gallery/misc/rasterization_demo`.

Returns
-------
`matplotlib.collections.QuadMesh`

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Additionally, the following arguments are allowed. They are passed
    along to the `~matplotlib.collections.QuadMesh` constructor:

%(QuadMesh:kwdoc)s

See Also
--------
pcolor : An alternative implementation with slightly different
    features. For a detailed discussion on the differences see
    :ref:`Differences between pcolor() and pcolormesh()
    <differences-pcolor-pcolormesh>`.
imshow : If *X* and *Y* are each equidistant, `~.Axes.imshow` can be a
    faster alternative.

Notes
-----
**Masked arrays**

*C* may be a masked array. If ``C[i, j]`` is masked, the corresponding
quadrilateral will be transparent. Masking of *X* and *Y* is not
supported. Use `~.Axes.pcolor` if you need this functionality.

.. _axes-pcolormesh-grid-orientation:

**Grid orientation**

The grid orientation follows the standard matrix convention: An array
*C* with shape (nrows, ncolumns) is plotted with the column number as
*X* and the row number as *Y*.

.. _differences-pcolor-pcolormesh:

**Differences between pcolor() and pcolormesh()**

Both methods are used to create a pseudocolor plot of a 2D array
using quadrilaterals.

The main difference lies in the created object and internal data
handling:
While `~.Axes.pcolor` returns a `.PolyQuadMesh`, `~.Axes.pcolormesh`
returns a `.QuadMesh`. The latter is more specialized for the given
purpose and thus is faster. It should almost always be preferred.

There is also a slight difference in the handling of masked arrays.
Both `~.Axes.pcolor` and `~.Axes.pcolormesh` support masked arrays
for *C*. However, only `~.Axes.pcolor` supports masked arrays for *X*
and *Y*. The reason lies in the internal handling of the masked values.
`~.Axes.pcolor` leaves out the respective polygons from the
PolyQuadMesh. `~.Axes.pcolormesh` sets the facecolor of the masked
elements to transparent. You can see the difference when using
edgecolors. While all edges are drawn irrespective of masking in a
QuadMesh, the edge between two adjacent masked quadrilaterals in
`~.Axes.pcolor` is not drawn as the corresponding polygons do not
exist in the PolyQuadMesh. Because PolyQuadMesh draws each individual
polygon, it also supports applying hatches and linestyles to the collection.

Another difference is the support of Gouraud shading in
`~.Axes.pcolormesh`, which is not available with `~.Axes.pcolor`.

Nr  r  rp   r  r  r  r  r  zpcolormesh.snap)r  r  r6  r  r  r  rt   r  r  r  Fr
  r   )r6   r7   r&   rd   r  r  r  r  QuadMeshr  r  r  r  r   r   r  r@  r  r  r=  r  rx   r]   r  rH  rI  r  r   r,   r   r   )r(   rt   r  r  r  r  r  r  r  rV   rC   rB  rC  r  r  r  r   r  r"  r$  r#  r%  r&  s                          r   r  Axes.pcolormesh  s   ~ ?ll#34G--/,/++L L4 L4;La1&r*&#,,/@"AB^^W +TeWOUW
 	//	4/Pt40A& !!1k3344.//##DII.AQ11$..ABB.M",,V4FJ6VVF+
dVVF+
d(,d|
!!!$(,d|
!!!$,t,G$$$&r   )rt   r  r  r  r  r  c                d   US   n	[         R                  " U	5      SS u  p[        U5      S:X  a  SnSU/nSU
/nGO[        U5      S:X  Ga  USS u  p[         R                  " U5      n[         R                  " U5      nUR                  S:X  Ga-  UR                  S:X  Ga  UR
                  S:X  a  UR
                  S:X  a  SnGObUR
                  US-   :w  a  [        SUR
                   S	U S
35      eUR
                  U
S-   :w  a  [        SUR
                   SU
 S
35      e[         R                  " U5      n[         R                  " U5      n[         R                  " U5      S[        UR                  5       5      -  :  a7  [         R                  " U5      S[        UR                  5       5      -  :  a  SnOmSnOjUR                  S:X  a  UR                  S:X  a  SnOG[        SUR                   SUR                   S35      e[        R                  " SS[        U5      5      e[        R                  R!                  XdUS9  US:X  a  [         R"                  " X/SS9n[         R                  " U	5      S;  a  [        S5      e[$        R&                  " UU	XX&SSS9nU R)                  USS9  UR+                  5       UR-                  5       UR+                  5       UR-                  5       4u  nnnnUnOsUS   US   US   US   4=nu  nnnnUS:X  a  [.        R0                  " U 4X2UXUSSS.UD6nO"US:X  a  [.        R2                  " XX4X2XaUS .UD6nU R5                  W5        Un[         R                  " U	5      S:X  a  UR7                  X$U5        UR9                  5       c  UR;                  U R<                  5        UU/UR>                  R@                  SS& UU/UR>                  RB                  SS& U RE                  [         RF                  " UU/UU//5      5        U RI                  S!S"9  U$ )#a  
Create a pseudocolor plot with a non-regular rectangular grid.

Call signature::

    ax.pcolorfast([X, Y], C, /, **kwargs)

The arguments *X*, *Y*, *C* are positional-only.

This method is similar to `~.Axes.pcolor` and `~.Axes.pcolormesh`.
It's designed to provide the fastest pcolor-type plotting with the
Agg backend. To achieve this, it uses different algorithms internally
depending on the complexity of the input grid (regular rectangular,
non-regular rectangular or arbitrary quadrilateral).

.. warning::

    This method is experimental. Compared to `~.Axes.pcolor` or
    `~.Axes.pcolormesh` it has some limitations:

    - It supports only flat shading (no outlines)
    - It lacks support for log scaling of the axes.
    - It does not have a pyplot wrapper.

Parameters
----------
C : array-like
    The image data. Supported array shapes are:

    - (M, N): an image with scalar data.  Color-mapping is controlled
      by *cmap*, *norm*, *vmin*, and *vmax*.
    - (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
    - (M, N, 4): an image with RGBA values (0-1 float or 0-255 int),
      i.e. including transparency.

    The first two dimensions (M, N) define the rows and columns of
    the image.

    This parameter can only be passed positionally.

X, Y : tuple or array-like, default: ``(0, N)``, ``(0, M)``
    *X* and *Y* are used to specify the coordinates of the
    quadrilaterals. There are different ways to do this:

    - Use tuples ``X=(xmin, xmax)`` and ``Y=(ymin, ymax)`` to define
      a *uniform rectangular grid*.

      The tuples define the outer edges of the grid. All individual
      quadrilaterals will be of the same size. This is the fastest
      version.

    - Use 1D arrays *X*, *Y* to specify a *non-uniform rectangular
      grid*.

      In this case *X* and *Y* have to be monotonic 1D arrays of length
      *N+1* and *M+1*, specifying the x and y boundaries of the cells.

      The speed is intermediate. Note: The grid is checked, and if
      found to be uniform the fast version is used.

    - Use 2D arrays *X*, *Y* if you need an *arbitrary quadrilateral
      grid* (i.e. if the quadrilaterals are not rectangular).

      In this case *X* and *Y* are 2D arrays with shape (M + 1, N + 1),
      specifying the x and y coordinates of the corners of the colored
      quadrilaterals.

      This is the most general, but the slowest to render.  It may
      produce faster and more compact output using ps, pdf, and
      svg backends, however.

    These arguments can only be passed positionally.

%(cmap_doc)s

    This parameter is ignored if *C* is RGB(A).

%(norm_doc)s

    This parameter is ignored if *C* is RGB(A).

%(vmin_vmax_doc)s

    This parameter is ignored if *C* is RGB(A).

%(colorizer_doc)s

    This parameter is ignored if *C* is RGB(A).

alpha : float, default: None
    The alpha blending value, between 0 (transparent) and 1 (opaque).

snap : bool, default: False
    Whether to snap the mesh to pixel boundaries.

Returns
-------
`.AxesImage` or `.PcolorImage` or `.QuadMesh`
    The return type depends on the type of grid:

    - `.AxesImage` for a regular rectangular grid.
    - `.PcolorImage` for a non-regular rectangular grid.
    - `.QuadMesh` for a non-rectangular grid.

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Supported additional parameters depend on the type of grid.
    See return types of *image* for further description.
r  Nr  r  imager   rD  zLength of X (z6) must be one larger than the number of columns in C (r  zLength of Y (z3) must be one larger than the number of rows in C (r  pcolorimagequadmeshz{When 3 positional parameters are passed to pcolorfast, the first two (X and Y) must be both 1D or both 2D; the given X was zD and the given Y was D
pcolorfastr  r  r  >   r  rD  zC must be 2D or 3DFrp   )r6  rt   r  r  r  r  r  r
  r  r&   )r  r  r  rX  rt   r
  rv  rw  )r  r  r  rt   r
  Tr  )%r  r  r   rA  rr  r  r   r  rh  r  r>  r   r   rH  
mcolorizerColorizingArtistr  r  r  r  r  rH  rI  r~  r  PcolorImager  r  r   r   r   r  r   r,   r   r6  r   )r(   rt   r  r  r  r  r  rV   rC   r  nrncstyler   r,   r{  r|  r  r  xlr<  ybr  retr
  r  s                             r   r  Axes.pcolorfast  s   l H!Rat9>EBABAY!^8DA

1A

1Avv{qvv{66Q;166Q;#Evva'(+AFF8 4779d!=> > vva'(+AFF8 44464q:  BBr
TC	N%::FF2JBGGI)>> ' -11"Qvvh4QVVHA?@ @
 ""<3t9EE##@@FJ 	A 	LJXXqf2.Fwwqz' !566aT!f6J 
E:UUWaeegquuw?NBBC '(dAbE1Q42&>>F^RR%%#)"+G 	
 -'''Q-I!- &,- NN2C771:?OOD-&djj)!#R1!#R1BHHr2hR%9:;$$4$0
r   c                 d    SUS'   [         R                  " U /UQ70 UD6nU R                  5         U$ )z
Plot contour lines.

Call signature::

    contour([X, Y,] Z, /, [levels], **kwargs)

The arguments *X*, *Y*, *Z* are positional-only.
%(contour_doc)s
FfilledmcontourQuadContourSetr   r(   rV   rC   contourss       r   contourAxes.contourg  s9     !x**4A$A&A$$&r   c                 d    SUS'   [         R                  " U /UQ70 UD6nU R                  5         U$ )z
Plot filled contours.

Call signature::

    contourf([X, Y,] Z, /, [levels], **kwargs)

The arguments *X*, *Y*, *Z* are positional-only.
%(contour_doc)s
Tr  r  r  s       r   contourfAxes.contourfy  s9      x**4A$A&A$$&r   c                 (    UR                   " U40 UD6$ )a  
Label a contour plot.

Adds labels to line contours in given `.ContourSet`.

Parameters
----------
CS : `.ContourSet` instance
    Line contours to label.

levels : array-like, optional
    A list of level values, that should be labeled. The list must be
    a subset of ``CS.levels``. If not given, all levels are labeled.

**kwargs
    All other parameters are documented in `~.ContourLabeler.clabel`.
)clabel)r(   CSlevelsrC   s       r   r  Axes.clabel  s    $ yy*6**r   re  weightsc                 v   UnSSK Jn  [        R                  " U5      (       a  U/nUc  [        R
                  S   n[        R                  " / SQUS9  [        R                  " / SQU	S9  [        R                  " S	S
/U
S9  US:X  a	  U(       d  Sn[        R                  " US5      n[        U5      nU
S
:X  a6  U R                  n/ U R                  SUS   4/U5      Q[        UUSS 5      QnO5U R                  n/ U R                  SUS   4/U5      Q[        UUSS 5      QnUb  U" U5      n[        R                  " U5      (       d  U" U5      nUb  [        R                  " US5      nOS/U-  n[        U5      U:w  a  [!        S5      eSn[#        UU5       H9  u  nn[        U5      nUb  [        U5      U:w  a  [!        S5      eU(       d  M7  SnM;     Uc1  U" U5       Vs/ s H  nU R$                  R'                  5       PM     nnO@[(        R*                  " U5      n[        U5      U:w  a  [!        SU S[        U5       S35      e[-        5       nUc  [        R.                  n[        R.                  * nU HU  n[        U5      (       d  M  [1        U[        R2                  " U5      5      n[5        U[        R6                  " U5      5      nMW     UU::  a  UU4nU(       dY  [        U5      S:  aJ  Ub  [        R8                  " U5      nOSn[        R:                  " [        R8                  " U5      UUU5      nOUUS'   [=        U5      nU(       a  U(       d  UUS'   / nU" U5       H7  n[        R>                  " UU   U4SUU   0UD6u  n nURA                  U 5        M9     [        RB                  " U[D        5      n[        RB                  " U[D        5      nU(       aC  URG                  SS9nU(       a-  U[        RH                  " U5      -  US   RK                  5       -  nU(       a  [M        S5      n![O        U[P        5      (       a  US:  a  [M        SSS5      n!U(       a5  U[        RH                  " U5      -  SS2U!4   RG                  SS9SS2U!4   nOUSS2U!4   RG                  SS9SS2U!4   n/ n"URS                  S5      (       Ga  [        RH                  " U5      n#Ub  [        RT                  " USS5      n$O3[        U5      S:  a"  U(       a  [        R
                  S   (       a  Sn$OSn$US:X  a#  U(       d  U$U#-  U-  n%U%n&SU$-  U#-  SSU-  -
  -  n'OUS:X  d  U(       a
  U$U#-  n%S u  n'n&U	S!:X  a	  W'S"U#-  -  n'OU	S#:X  a  W'U#-  n'U
S	:X  a  U RV                  n(S$n)OU RX                  n(S%n)[#        UU5       Hm  u  n*nUc  [        RZ                  " [        U*5      5      nU(       a  U*U-
  n+OU*n+U(" USS W'-   U+W%4S&UUS'.U)U0D6n,U"RA                  U,5        U(       a  U*nU'W&-  n'Mo     U"SS  H>  n,U, H5  n-/ =U-R\                  R^                  SS& U-R\                  R`                  SS& M7     M@     GOURS                  S(5      (       Ga  [        RZ                  " S)[        U5      -  S*-
  5      n[        RZ                  " S)[        U5      -  S*-
  5      n.X"SS sUSS+[        U5      -  S-
  S+2'   USS+[        U5      -  S-
  S+2'   USS+[        U5      -  S-
   SSS2   US+[        U5      -  S-
  S& Uc  SnU=U.SS+[        U5      -  S-
  S+2'   U.S+S+[        U5      -  S+2'   U.SS+[        U5      -  S-
   SSS2   U.S+[        U5      -  S-
  S& U(       a'  U
S	:X  a  U Rc                  S,S-S.9  OU Re                  S,S-S.9  U	S$:X  a  US"US   US   -
  -  -  nOU	S#:X  a  US"US   US   -
  -  -  nUS/:H  n// / n1n0U H  n*U(       a,  U.SS+[        U5      -  S-
   SSS2   U.S+[        U5      -  S-
  S& U*U-   =U.SS+[        U5      -  S-
  S+2'   U.S+S+[        U5      -  S+2'   U.S   U.S'   U
S	:X  a@  U0RA                  U.Rg                  5       5        U1RA                  URg                  5       5        M  U0RA                  URg                  5       5        U1RA                  U.Rg                  5       5        M     U/(       a  SOS+[        U5      -  n2[i        [k        [#        U0U1U5      5      5       Hm  u  nn.nU"RA                  U Rm                  USU2 U.SU2 U/(       a  SOSUU/(       a  SOUU/(       a  U/OSU/(       a  SO[n        Rp                  Rr                  S095        Mo     U" Hf  n3U3 H]  n-U
S
:X  a'  U-R\                  R`                  RA                  S5        M0  U
S	:X  d  M8  U-R\                  R^                  RA                  S5        M_     Mh     U"Ru                  5         Uc  / O.[        Rv                  " [        Rx                  " U[z        5      5      n4US(:X  a;  [|        R~                  " [        Rv                  " UR                  S1U5      5      5      n5O:[|        R~                  " [        Rv                  " UR                  S1S5      5      5      n5[|        R~                  " [        Rv                  " UR                  S2U5      5      5      n6[|        R~                  " [        Rv                  " UR                  S3S5      5      5      n7[|        R~                  " [        Rv                  " UR                  S4S5      5      5      n8[|        R~                  " [        Rv                  " UR                  S5S5      5      5      n9[|        R                  " U"U45       H  u  n-n:U-(       d  M  U-S   n;UR                  [        U75      [        U85      [        U95      [        U55      [        U65      S6.5        U;R                  U5        U:b  U;R                  U:5        U-SS  H%  n;U;R                  U5        U;R                  S75        M'     M     US:X  a  US   UU"S   4$ URS                  S5      (       a  S8OS9n<UU[        R                  " U<U"5      4$ s  snf ):a  
Compute and plot a histogram.

This method uses `numpy.histogram` to bin the data in *x* and count the
number of values in each bin, then draws the distribution either as a
`.BarContainer` or `.Polygon`. The *bins*, *range*, *density*, and
*weights* parameters are forwarded to `numpy.histogram`.

If the data has already been binned and counted, use `~.bar` or
`~.stairs` to plot the distribution::

    counts, bins = np.histogram(x)
    plt.stairs(counts, bins)

Alternatively, plot pre-computed bins and counts using ``hist()`` by
treating each bin as a single point with a weight equal to its count::

    plt.hist(bins[:-1], bins, weights=counts)

The data input *x* can be a singular array, a list of datasets of
potentially different lengths ([*x0*, *x1*, ...]), or a 2D ndarray in
which each column is a dataset. Note that the ndarray form is
transposed relative to the list form. If the input is an array, then
the return value is a tuple (*n*, *bins*, *patches*); if the input is a
sequence of arrays, then the return value is a tuple
([*n0*, *n1*, ...], *bins*, [*patches0*, *patches1*, ...]).

Masked arrays are not supported.

Parameters
----------
x : (n,) array or sequence of (n,) arrays
    Input values, this takes either a single array or a sequence of
    arrays which are not required to be of the same length.

bins : int or sequence or str, default: :rc:`hist.bins`
    If *bins* is an integer, it defines the number of equal-width bins
    in the range.

    If *bins* is a sequence, it defines the bin edges, including the
    left edge of the first bin and the right edge of the last bin;
    in this case, bins may be unequally spaced.  All but the last
    (righthand-most) bin is half-open.  In other words, if *bins* is::

        [1, 2, 3, 4]

    then the first bin is ``[1, 2)`` (including 1, but excluding 2) and
    the second ``[2, 3)``.  The last bin, however, is ``[3, 4]``, which
    *includes* 4.

    If *bins* is a string, it is one of the binning strategies
    supported by `numpy.histogram_bin_edges`: 'auto', 'fd', 'doane',
    'scott', 'stone', 'rice', 'sturges', or 'sqrt'.

range : tuple or None, default: None
    The lower and upper range of the bins. Lower and upper outliers
    are ignored. If not provided, *range* is ``(x.min(), x.max())``.
    Range has no effect if *bins* is a sequence.

    If *bins* is a sequence or *range* is specified, autoscaling
    is based on the specified bin range instead of the
    range of x.

density : bool, default: False
    If ``True``, draw and return a probability density: each bin
    will display the bin's raw count divided by the total number of
    counts *and the bin width*
    (``density = counts / (sum(counts) * np.diff(bins))``),
    so that the area under the histogram integrates to 1
    (``np.sum(density * np.diff(bins)) == 1``).

    If *stacked* is also ``True``, the sum of the histograms is
    normalized to 1.

weights : (n,) array-like or None, default: None
    An array of weights, of the same shape as *x*.  Each value in
    *x* only contributes its associated weight towards the bin count
    (instead of 1).  If *density* is ``True``, the weights are
    normalized, so that the integral of the density over the range
    remains 1.

cumulative : bool or -1, default: False
    If ``True``, then a histogram is computed where each bin gives the
    counts in that bin plus all bins for smaller values. The last bin
    gives the total number of datapoints.

    If *density* is also ``True`` then the histogram is normalized such
    that the last bin equals 1.

    If *cumulative* is a number less than 0 (e.g., -1), the direction
    of accumulation is reversed.  In this case, if *density* is also
    ``True``, then the histogram is normalized such that the first bin
    equals 1.

bottom : array-like or float, default: 0
    Location of the bottom of each bin, i.e. bins are drawn from
    ``bottom`` to ``bottom + hist(x, bins)`` If a scalar, the bottom
    of each bin is shifted by the same amount. If an array, each bin
    is shifted independently and the length of bottom must match the
    number of bins. If None, defaults to 0.

histtype : {'bar', 'barstacked', 'step', 'stepfilled'}, default: 'bar'
    The type of histogram to draw.

    - 'bar' is a traditional bar-type histogram.  If multiple data
      are given the bars are arranged side by side.
    - 'barstacked' is a bar-type histogram where multiple
      data are stacked on top of each other.
    - 'step' generates a lineplot that is by default unfilled.
    - 'stepfilled' generates a lineplot that is by default filled.

align : {'left', 'mid', 'right'}, default: 'mid'
    The horizontal alignment of the histogram bars.

    - 'left': bars are centered on the left bin edges.
    - 'mid': bars are centered between the bin edges.
    - 'right': bars are centered on the right bin edges.

orientation : {'vertical', 'horizontal'}, default: 'vertical'
    If 'horizontal', `~.Axes.barh` will be used for bar-type histograms
    and the *bottom* kwarg will be the left edges.

rwidth : float or None, default: None
    The relative width of the bars as a fraction of the bin width.  If
    ``None``, automatically compute the width.

    Ignored if *histtype* is 'step' or 'stepfilled'.

log : bool, default: False
    If ``True``, the histogram axis will be set to a log scale.

color : :mpltype:`color` or list of :mpltype:`color` or None, default: None
    Color or sequence of colors, one per dataset.  Default (``None``)
    uses the standard line color sequence.

label : str or list of str, optional
    String, or sequence of strings to match multiple datasets.  Bar
    charts yield multiple patches per dataset, but only the first gets
    the label, so that `~.Axes.legend` will work as expected.

stacked : bool, default: False
    If ``True``, multiple data are stacked on top of each other If
    ``False`` multiple data are arranged side by side if histtype is
    'bar' or on top of each other if histtype is 'step'

Returns
-------
n : array or list of arrays
    The values of the histogram bins. See *density* and *weights* for a
    description of the possible semantics.  If input *x* is an array,
    then this is an array of length *nbins*. If input is a sequence of
    arrays ``[data1, data2, ...]``, then this is a list of arrays with
    the values of the histograms for each of the arrays in the same
    order.  The dtype of the array *n* (or of its element arrays) will
    always be float even if no weighting or normalization is used.

bins : array
    The edges of the bins. Length nbins + 1 (nbins left edges and right
    edge of last bin).  Always a single array even when multiple data
    sets are passed in.

patches : `.BarContainer` or list of a single `.Polygon` or list of such objects
    Container of individual artists used to create the histogram
    or list of such containers if there are multiple input datasets.

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    `~matplotlib.patches.Patch` properties. The following properties
    additionally accept a sequence of values corresponding to the
    datasets in *x*:
    *edgecolor*, *facecolor*, *linewidth*, *linestyle*, *hatch*.

    .. versionadded:: 3.10
       Allowing sequences of values in above listed Patch properties.

See Also
--------
hist2d : 2D histogram with rectangular bins
hexbin : 2D histogram with hexagonal bins
stairs : Plot a pre-computed histogram
bar : Plot a pre-computed histogram

Notes
-----
For large numbers of bins (>1000), plotting can be significantly
accelerated by using `~.Axes.stairs` to plot a pre-computed histogram
(``plt.stairs(*np.histogram(data))``), or by setting *histtype* to
'step' or 'stepfilled' rather than 'bar' or 'barstacked'.
r   )re  Nz	hist.bins)r  
barstackedr  
stepfilled)histtype)r   r  r   r  r1  r<  r  r  Tr   r  r,   r  z'weights should have the same shape as xFzBThe 'color' keyword argument must have one color per dataset, but z datasets and z colors were providedre  densityr  r  r  rG  皙?r.   r  )r  r  r  rq   r   r   r   r   )r  ru  r5   r  r  rD  r  ru  r  r  r  )closedrr   rs   rV  r^   rs   rr   r  r8  r9  )r  r8  r9  rs   rr   r  r   zlist[Polygon])Gbuiltinsre  r  ri  r6   r7   r   r  r9   _reshape_2Dr   r  r   rh  r  rk  r   r   r[  r  rB  rC  r{  infrH  r  rI  r  r  histogram_bin_edgesr  	histogramr   r6  r<   rE  r  rs  r  r   r   r0  r  r   r  r  r  r   r,   rw  rx  r   reversedrF  rV  r   r   r^   reverser  rA  r  r  r  r   r  r>   ra  r?   r   silent_list)=r(   r   r  re  r  r  
cumulativer   r  r  r,  rwidthru  r5   r@   stackedrC   	bin_ranger  rm  r  input_emptyxiwilen_xir&  r  hist_kwargsr   r   _wtopsmslcr  totwidthdrr  dwboffset_barfuncbottom_kwargr   r  r   r   r,   rV  xvalsyvalsr1  
patch_listrM   r  r  hatchesr0  r	  r  r   
patch_types=                                                                r   hist	Axes.hist  s   R 	";;q>>A<<<,D 	F$,	.35AL*5;O|#GG a%V
 *$ //M-$))C1;-@ -mQqrU+-A !//M-$))C1;-@ -mQqrU+-A  %i0I((.. &D !!'95AAq6R<FGG!QiFBWF~#b'V"3 !JKKv#   =@Eb	J	1doo446	FJF**51F6{b   $;;=$n$'K=0E"G H H f
 66DFF7Dr77 tRYYr]3DtRYYr]3D  t|!4L	
 s1vz"^^A&))q!4B8D $-K w-7%,K	" rA ll1Q4KqtK{KGAtKKN	 
 xxe$xxe$;;A;&D rwwt},R>+C*f--*q.D$+rwwt},af5<<!<DQVLAsF|***21c6:u%%wwt}H!WWVQ*d)a-CLL1I$J5 X*)h.!a"f*=\)WX&~3>)'!8#l*99%88'!$/
U>XXc#h/F 6\F FSb	' 165 G&.C&+G0<f/EG t$ F2 0"  !EHJJE&&((+e.@.@.B.B1.E " $   ((SY*+ASY*+A9=CRy6Aa#d)Aa !AaD	k!mA$5"6 !!Ac$iKM 24R4 8AaD	k!mn~8>>Aa#d)Aa 1QqT{1_#5 !!Ac$iKM 24R4 8AaD	k!mn,.OOEvO>OOEvO>S$q'$q'/**'!S$q'$q'/** ,Dr5E()!Ac$iKM(:4R4(@AaD	k!mn%<?&LH!Ac$iKM!#$q1SY;q'9 u!,.LL*LL*LL*LL*% * BAD	ME  (Sv-F(GH1etyyfuIq%y#'4T#&*d!%4#'4V]]-A-A  )  C D  I &
'E"j0**,,33A6$4**,,33A6	 ( & OO }"--

5#8N*Ov"vzz+BH8J *K LJ #vzz+t7T)UVJ__R]]6::k63R%ST
//"--

7D0I"JK__R]]6::k43P%QR
__R]]6::k43P%QR
#//@JE3aAMMg!*-!*-!*-!*-  v&C 12Y""6*L)  A$ 77D'!*,,,4,?,?,F,F.. u00WEEES Ks   %$r6)r,  r/   rV  c                   SU;   a  UR                  S5      nOU R                  R                  5       nU(       a%  UR                  SS5        UR                  SU5        OUR                  SU5        Uc"  [        R
                  " [        U5      S-   5      nU R                  SU4SU4SU4/U5      u  p!n[        R                  " UU4UUUS	.UD6nU R                  U5        Uc&  U(       a  [        R                  " S
U< SU< S35        Ub  US:X  ae  UR                  R                  R                  [        R                   " U5      5        U R#                  US   [        R                   " U5      4/5        OdUR                  R$                  R                  [        R                   " U5      5        U R#                  [        R                   " U5      US   4/5        U R'                  5         U$ )a  
Draw a stepwise constant function as a line or a filled plot.

*edges* define the x-axis positions of the steps. *values* the function values
between these steps. Depending on *fill*, the function is drawn either as a
continuous line with vertical segments at the edges, or as a filled area.

Parameters
----------
values : array-like
    The step heights.

edges : array-like
    The step 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.

    If None, then drawn as an unclosed Path.

fill : bool, default: False
    Whether the area under the step curve should be filled.

    Passing both ``fill=True` and ``baseline=None`` will likely result in
    undesired filling: the first and last points will be connected
    with a straight line and the fill will be between this line and the stairs.


Returns
-------
StepPatch : `~matplotlib.patches.StepPatch`

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    `~matplotlib.patches.StepPatch` properties

r5   r8  r   rr   rs   r  r   r,   )r/   r,  rV  zBoth baseline=z
 and fill=a[   have been passed. baseline=None is only intended for unfilled stair plots. Because baseline is None, the Path used to draw the stairs will not be closed, thus because fill is True the polygon will be closed by drawing an (unstroked) edge from the first to last point.  It is very likely that the resulting fill patterns is not the desired result.r<  )r  r[  r  rd   r  r  r   r   r   	StepPatchr   r   r  r  r,   r   rH  r   r   r   )	r(   r7  edgesr,  r/   rV  rC   _colorr   s	            r   stairsAxes.stairs  s   j fZZ(F__335Fk1-k62k62=IIc&kAo.E"&"9"95\C=3/:F#Dx ""6#(-,4/:(,	-
 &,- 	u!{+w /  j(""$$++BFF8,<=##eAhx0@%A$BC""$$++BFF8,<=##bffX&6a%A$BC$$&r   )r   r,   r  c	           	          [         R                  " XX4XVS9u  pnUb  SXU:  '   Ub  SXU:  '   U R                  " XU
R                  40 U	D6nU R	                  US   US   5        U R                  US   US   5        XX4$ )ad
  
Make a 2D histogram plot.

Parameters
----------
x, y : array-like, shape (n, )
    Input values

bins : None or int or [int, int] or array-like or [array, array]

    The bin specification:

    - If int, the number of bins for the two dimensions
      (``nx = ny = bins``).
    - If ``[int, int]``, the number of bins in each dimension
      (``nx, ny = bins``).
    - If array-like, the bin edges for the two dimensions
      (``x_edges = y_edges = bins``).
    - If ``[array, array]``, the bin edges in each dimension
      (``x_edges, y_edges = bins``).

    The default value is 10.

range : array-like shape(2, 2), optional
    The leftmost and rightmost edges of the bins along each dimension
    (if not specified explicitly in the bins parameters): ``[[xmin,
    xmax], [ymin, ymax]]``. All values outside of this range will be
    considered outliers and not tallied in the histogram.

density : bool, default: False
    Normalize histogram.  See the documentation for the *density*
    parameter of `~.Axes.hist` for more details.

weights : array-like, shape (n, ), optional
    An array of values w_i weighing each sample (x_i, y_i).

cmin, cmax : float, default: None
    All bins that has count less than *cmin* or more than *cmax* will not be
    displayed (set to NaN before passing to `~.Axes.pcolormesh`) and these count
    values in the return value count histogram will also be set to nan upon
    return.

Returns
-------
h : 2D array
    The bi-dimensional histogram of samples x and y. Values in x are
    histogrammed along the first dimension and values in y are
    histogrammed along the second dimension.
xedges : 1D array
    The bin edges along the x-axis.
yedges : 1D array
    The bin edges along the y-axis.
image : `~.matplotlib.collections.QuadMesh`

Other Parameters
----------------
%(cmap_doc)s

%(norm_doc)s

%(vmin_vmax_doc)s

%(colorizer_doc)s

alpha : ``0 <= scalar <= 1`` or ``None``, optional
    The alpha blending value.

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Additional parameters are passed along to the
    `~.Axes.pcolormesh` method and `~matplotlib.collections.QuadMesh`
    constructor.

See Also
--------
hist : 1D histogram plotting
hexbin : 2D histogram with hexagonal bins

Notes
-----
- Currently ``hist2d`` calculates its own axis limits, and any limits
  previously set are ignored.
- Rendering the histogram with a logarithmic color scale is
  accomplished by passing a `.colors.LogNorm` instance to the *norm*
  keyword argument. Likewise, power-law normalization (similar
  in effect to gamma correction) can be accomplished with
  `.colors.PowerNorm`.
)r  re  r  r  Nr   r  )r  histogram2dr  r  set_xlimset_ylim)r(   r   r,   r  re  r  r  cmincmaxrC   r  xedgesyedgespcs                 r   hist2dAxes.hist2d  s    @ NN1d3:M6 A$hKA$hK__VQSS;F;fQi,fQi,&$$r   )complementaryr,  compressc                   [         R                  " SS/US9  SU;   d  SU;   a  [        S5      e[        R                  R                  U5      R                  5       (       a  [        S5      e[        R                  " U5      n[        R                  " U5      R                  5       (       a  [        S5      e[        R                  " U5      nX   nUc/  S
[        R                  " [        U5      5      -   [        U5      -  nOC[        R                  " X'5      n[        R                  " U[        R                  " U5      -  5      nU(       a*  S/US	S US
S	 :g  R!                  5       S   S
-   Qn	X   nX   nUS:X  ak  U(       d"  U R"                  " US   /UQS/UQ4SS0UD6u  n
O%U R"                  " / UQUS   PS
/S
U-
  Q4SS0UD6u  n
SS
/U
R$                  R&                  S	S	& U
$ U(       d"  U R"                  " S/UQUS   /UQ4SS0UD6u  n
O%U R"                  " S
/S
U-
  Q/ UQUS   P4SS0UD6u  n
SS
/U
R$                  R(                  S	S	& U
$ )a  
Compute and plot the empirical cumulative distribution function of *x*.

.. versionadded:: 3.8

Parameters
----------
x : 1d array-like
    The input data.  Infinite entries are kept (and move the relevant
    end of the ecdf from 0/1), but NaNs and masked values are errors.

weights : 1d array-like or None, default: None
    The weights of the entries; must have the same shape as *x*.
    Weights corresponding to NaN data points are dropped, and then the
    remaining weights are normalized to sum to 1.  If unset, all
    entries have the same weight.

complementary : bool, default: False
    Whether to plot a cumulative distribution function, which increases
    from 0 to 1 (the default), or a complementary cumulative
    distribution function, which decreases from 1 to 0.

orientation : {"vertical", "horizontal"}, default: "vertical"
    Whether the entries are plotted along the x-axis ("vertical", the
    default) or the y-axis ("horizontal").  This parameter takes the
    same values as in `~.Axes.hist`.

compress : bool, default: False
    Whether multiple entries with the same values are grouped together
    (with a summed weight) before plotting.  This is mainly useful if
    *x* contains many identical data points, to decrease the rendering
    complexity of the plot. If *x* contains no duplicate points, this
    has no effect and just uses some time and memory.

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Keyword arguments control the `.Line2D` properties:

    %(Line2D:kwdoc)s

Returns
-------
`.Line2D`

Notes
-----
The ecdf plot can be thought of as a cumulative histogram with one bin
per data entry; i.e. it reports on the entire dataset without any
arbitrary binning.

If *x* contains NaNs or masked entries, either remove them first from
the array (if they should not taken into account), or replace them by
-inf or +inf (if they should be sorted at the beginning or the end of
the array).
r1  r<  r  r  dsz)Cannot pass 'drawstyle' or 'ds' to ecdf()z&ecdf() does not support masked entrieszecdf() does not support NaNsNr  r   r  z
steps-postz	steps-pre)r   r  r   r  r  getmaskr=  r   rA  r  argsortr  r   takerE  rs  nonzeror\  r  r,   r   )r(   r   r  r   r,  r!  rC   r%  cum_weightscompress_idxsr   s              r   ecdf	Axes.ecdf^  ss   ~ 	L*5;O& DFNGHH55==!!EFFJJqM88A;??;<<**Q-J?ryyQ00CF:Kggg/G))GbffWo$=>KD!CR&AabE/!:!:!<Q!?!!CDM A%4K*$ 		1Q4*!*q.?;.? D,8D<BD 		+A+qu+/DAO/D C,7C;AC&'VD"  !		1"3{"3adZQZ C,7C;AC 		1"7q;"71ae D,8D<BD&'VD"r   NFFTc                 n   Uc  Sn[         R                  " XX5XgUXS9	u  pX-  nU
S;   a  SnOSnU R                  " US[        R                  " U5      -  40 UD6nU R                  S5        U R                  SU-  5        U R                  S	5        U R                  5       u  nn[        S[        [        R                  " UU-
  5      5      -  S
5      n[        R                  " [        R                  " U5      [        R                  " U5      S
-   U5      nU R                  U5        Ub  U(       d  X4$ XU4$ )aT  
Plot the power spectral density.

The power spectral density :math:`P_{xx}` by Welch's average
periodogram method.  The vector *x* is divided into *NFFT* length
segments.  Each segment is detrended by function *detrend* and
windowed by function *window*.  *noverlap* gives the length of
the overlap between segments.  The :math:`|\mathrm{fft}(i)|^2`
of each segment :math:`i` are averaged to compute :math:`P_{xx}`,
with a scaling to correct for power loss due to windowing.

If len(*x*) < *NFFT*, it will be zero padded to *NFFT*.

Parameters
----------
x : 1-D array or sequence
    Array or sequence containing the data

%(Spectral)s

%(PSD)s

noverlap : int, default: 0 (no overlap)
    The number of points of overlap between segments.

Fc : int, default: 0
    The center frequency of *x*, which offsets the x extents of the
    plot to reflect the frequency range used when a signal is acquired
    and then filtered and downsampled to baseband.

return_line : bool, default: False
    Whether to include the line object plotted in the returned values.

Returns
-------
Pxx : 1-D array
    The values for the power spectrum :math:`P_{xx}` before scaling
    (real valued).

freqs : 1-D array
    The frequencies corresponding to the elements in *Pxx*.

line : `~matplotlib.lines.Line2D`
    The line created by this function.
    Only returned if *return_line* is True.

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Keyword arguments control the `.Line2D` properties:

    %(Line2D:kwdoc)s

See Also
--------
specgram
    Differs in the default overlap; in not returning the mean of the
    segment periodograms; in returning the times of the segments; and
    in plotting a colormap instead of a line.
magnitude_spectrum
    Plots the magnitude spectrum.
csd
    Plots the spectral density between two signals.

Notes
-----
For plotting, the power is plotted as
:math:`10\log_{10}(P_{xx})` for decibels, though *Pxx* itself
is returned.

References
----------
Bendat & Piersol -- Random Data: Analysis and Measurement Procedures,
John Wiley & Sons (1986)
r   )	r   r,  Fsr  windownoverlappad_tosidesscale_by_freq)NTzdB/HzdBr  	FrequencyzPower Spectral Density (%s)Tr  )mlabpsdr\  r  r  
set_xlabel
set_ylabelr   r   rI  r  r  rv  r  ceil
set_yticks)r(   r   r,  r.  Fcr  r/  r0  r1  r2  r3  return_linerC   pxxfreqs	psd_unitsr   r  r  r  tickss                        r   r7  Axes.psd  s   h :BXX%+v$)H
 	L(IIyyRXXc] 2=f=$5	AB		$__&
d2BHHTD[122A6		$**T*DIIdOa,?Fk:t##r   c                 |   Uc  Sn[         R                  " XX4UXxU	XS9
u  pX-  nU R                  " US[        R                  " [        R
                  " U5      5      -  40 UD6nU R                  S5        U R                  S5        U R                  S5        U R                  5       u  nn[        S[        [        R                  " UU-
  5      5      -  S5      n[        R                  " [        R                  " U5      [        R                  " U5      S-   U5      nU R!                  U5        Ub  U(       d  X4$ XU4$ )a  
Plot the cross-spectral density.

The cross spectral density :math:`P_{xy}` by Welch's average
periodogram method.  The vectors *x* and *y* are divided into
*NFFT* length segments.  Each segment is detrended by function
*detrend* and windowed by function *window*.  *noverlap* gives
the length of the overlap between segments.  The product of
the direct FFTs of *x* and *y* are averaged over each segment
to compute :math:`P_{xy}`, with a scaling to correct for power
loss due to windowing.

If len(*x*) < *NFFT* or len(*y*) < *NFFT*, they will be zero
padded to *NFFT*.

Parameters
----------
x, y : 1-D arrays or sequences
    Arrays or sequences containing the data.

%(Spectral)s

%(PSD)s

noverlap : int, default: 0 (no overlap)
    The number of points of overlap between segments.

Fc : int, default: 0
    The center frequency of *x*, which offsets the x extents of the
    plot to reflect the frequency range used when a signal is acquired
    and then filtered and downsampled to baseband.

return_line : bool, default: False
    Whether to include the line object plotted in the returned values.

Returns
-------
Pxy : 1-D array
    The values for the cross spectrum :math:`P_{xy}` before scaling
    (complex valued).

freqs : 1-D array
    The frequencies corresponding to the elements in *Pxy*.

line : `~matplotlib.lines.Line2D`
    The line created by this function.
    Only returned if *return_line* is True.

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Keyword arguments control the `.Line2D` properties:

    %(Line2D:kwdoc)s

See Also
--------
psd : is equivalent to setting ``y = x``.

Notes
-----
For plotting, the power is plotted as
:math:`10 \log_{10}(P_{xy})` for decibels, though :math:`P_{xy}` itself
is returned.

References
----------
Bendat & Piersol -- Random Data: Analysis and Measurement Procedures,
John Wiley & Sons (1986)
r   )
r   r,   r,  r.  r  r/  r0  r1  r2  r3  r  r5  zCross Spectrum Magnitude (dB)Tr  )r6  csdr\  r  r  r  r8  r9  r   r   rI  r  r  rv  r  r:  r;  )r(   r   r,   r,  r.  r<  r  r/  r0  r1  r2  r3  r=  rC   pxyr?  r   r  r  r  rA  s                        r   rD  Axes.csd4  s   ^ :BXXT'%+v$)H
 	yyRXXbffSk%: :EfE$78		$__&
d2BHHTD[122A6		$**T*DIIdOa,?Fk:t##r   r.  c                 8   Uc  Sn[         R                  " XUXVS9u  pX-  n
[        R                  " SSSSS.US9nUS:X  a  U	nOS[        R
                  " U	5      -  nU R                  " X40 UD6u  nU R                  S5        U R                  S	U-  5        XU4$ )
a  
Plot the magnitude spectrum.

Compute the magnitude spectrum of *x*.  Data is padded to a
length of *pad_to* and the windowing function *window* is applied to
the signal.

Parameters
----------
x : 1-D array or sequence
    Array or sequence containing the data.

%(Spectral)s

%(Single_Spectrum)s

scale : {'default', 'linear', 'dB'}
    The scaling of the values in the *spec*.  'linear' is no scaling.
    'dB' returns the values in dB scale, i.e., the dB amplitude
    (20 * log10). 'default' is 'linear'.

Fc : int, default: 0
    The center frequency of *x*, which offsets the x extents of the
    plot to reflect the frequency range used when a signal is acquired
    and then filtered and downsampled to baseband.

Returns
-------
spectrum : 1-D array
    The values for the magnitude spectrum before scaling (real valued).

freqs : 1-D array
    The frequencies corresponding to the elements in *spectrum*.

line : `~matplotlib.lines.Line2D`
    The line created by this function.

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Keyword arguments control the `.Line2D` properties:

    %(Line2D:kwdoc)s

See Also
--------
psd
    Plots the power spectral density.
angle_spectrum
    Plots the angles of the corresponding frequencies.
phase_spectrum
    Plots the phase (unwrapped angle) of the corresponding frequencies.
specgram
    Can plot the magnitude spectrum of segments within the signal in a
    colormap.
r   r   r.  r/  r1  r2  energyr4  )NrD   r   r4  )scale      4@r5  zMagnitude (%s))	r6  magnitude_spectrumr   r%   r  r  r\  r8  r9  )r(   r   r.  r<  r/  r1  r2  rJ  rC   specr?  yunitsZr   s                 r   rL  Axes.magnitude_spectrum  s    B :B--5;J##H XAbhhtn$A		%-f-$(612D  r   c                     Uc  Sn[         R                  " XUXVS9u  pX-  n	U R                  " X40 UD6n
U R                  S5        U R	                  S5        XU
S   4$ )a  
Plot the angle spectrum.

Compute the angle spectrum (wrapped phase spectrum) of *x*.
Data is padded to a length of *pad_to* and the windowing function
*window* is applied to the signal.

Parameters
----------
x : 1-D array or sequence
    Array or sequence containing the data.

%(Spectral)s

%(Single_Spectrum)s

Fc : int, default: 0
    The center frequency of *x*, which offsets the x extents of the
    plot to reflect the frequency range used when a signal is acquired
    and then filtered and downsampled to baseband.

Returns
-------
spectrum : 1-D array
    The values for the angle spectrum in radians (real valued).

freqs : 1-D array
    The frequencies corresponding to the elements in *spectrum*.

line : `~matplotlib.lines.Line2D`
    The line created by this function.

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Keyword arguments control the `.Line2D` properties:

    %(Line2D:kwdoc)s

See Also
--------
magnitude_spectrum
    Plots the magnitudes of the corresponding frequencies.
phase_spectrum
    Plots the unwrapped version of this function.
specgram
    Can plot the angle spectrum of segments within the signal in a
    colormap.
r   rH  r5  zAngle (radians))r6  angle_spectrumr\  r8  r9  r(   r   r.  r<  r/  r1  r2  rC   rM  r?  r  s              r   rR  Axes.angle_spectrum  k    r :B))AV17F		%00$)*E!H$$r   c                     Uc  Sn[         R                  " XUXVS9u  pX-  n	U R                  " X40 UD6n
U R                  S5        U R	                  S5        XU
S   4$ )a  
Plot the phase spectrum.

Compute the phase spectrum (unwrapped angle spectrum) of *x*.
Data is padded to a length of *pad_to* and the windowing function
*window* is applied to the signal.

Parameters
----------
x : 1-D array or sequence
    Array or sequence containing the data

%(Spectral)s

%(Single_Spectrum)s

Fc : int, default: 0
    The center frequency of *x*, which offsets the x extents of the
    plot to reflect the frequency range used when a signal is acquired
    and then filtered and downsampled to baseband.

Returns
-------
spectrum : 1-D array
    The values for the phase spectrum in radians (real valued).

freqs : 1-D array
    The frequencies corresponding to the elements in *spectrum*.

line : `~matplotlib.lines.Line2D`
    The line created by this function.

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Keyword arguments control the `.Line2D` properties:

    %(Line2D:kwdoc)s

See Also
--------
magnitude_spectrum
    Plots the magnitudes of the corresponding frequencies.
angle_spectrum
    Plots the wrapped version of this function.
specgram
    Can plot the phase spectrum of segments within the signal in a
    colormap.
r   rH  r5  zPhase (radians))r6  phase_spectrumr\  r8  r9  rS  s              r   rW  Axes.phase_spectrum8  rU  r      r  rD   c                     [         R                  " XX4UXxXU	S9
u  pX-  nU R                  " X40 UD6  U R                  S5        U R	                  S5        U R                  S5        X4$ )a  
Plot the coherence between *x* and *y*.

Coherence is the normalized cross spectral density:

.. math::

  C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}}

Parameters
----------
%(Spectral)s

%(PSD)s

noverlap : int, default: 0 (no overlap)
    The number of points of overlap between blocks.

Fc : int, default: 0
    The center frequency of *x*, which offsets the x extents of the
    plot to reflect the frequency range used when a signal is acquired
    and then filtered and downsampled to baseband.

Returns
-------
Cxy : 1-D array
    The coherence vector.

freqs : 1-D array
    The frequencies for the elements in *Cxy*.

Other Parameters
----------------
data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

**kwargs
    Keyword arguments control the `.Line2D` properties:

    %(Line2D:kwdoc)s

References
----------
Bendat & Piersol -- Random Data: Analysis and Measurement Procedures,
John Wiley & Sons (1986)
)
r   r,   r,  r.  r  r/  r0  r3  r2  r1  r5  	CoherenceT)r6  coherer\  r8  r9  r   )r(   r   r,   r,  r.  r<  r  r/  r0  r1  r2  r3  rC   cxyr?  s                  r   r\  Axes.cohere~  si    h [[1W(./<(.0
 			%''$$		$zr   c                    Uc  SnUc  SnUc  SnUc  SnUS:X  a  [        S5      eUb  US:X  a  US;   a  S	nOS
nOUS;   a  US
:X  a  [        S5      e[        R                  " XUXVXzUUUS9
u  nnnUS	:X  a  UnOXUS
:X  aC  Ub  US:X  d  US:X  a  S[        R                  " U5      -  nO)S[        R                  " U5      -  nO[        SU< 35      e[        R
                  " U5      nU	c<  X'-
  U-  S-  n[        R                  " U5      U-
  [        R                  " U5      U-   4n	U	u  nnUU-  nUUUS   US   4nSU;   a  [        R                  " SS5      eU R                  " UU4UUUSS.UD6nU R                  S5        UUUU4$ )a  
Plot a spectrogram.

Compute and plot a spectrogram of data in *x*.  Data are split into
*NFFT* length segments and the spectrum of each section is
computed.  The windowing function *window* is applied to each
segment, and the amount of overlap of each segment is
specified with *noverlap*. The spectrogram is plotted as a colormap
(using imshow).

Parameters
----------
x : 1-D array or sequence
    Array or sequence containing the data.

%(Spectral)s

%(PSD)s

mode : {'default', 'psd', 'magnitude', 'angle', 'phase'}
    What sort of spectrum to use.  Default is 'psd', which takes the
    power spectral density.  'magnitude' returns the magnitude
    spectrum.  'angle' returns the phase spectrum without unwrapping.
    'phase' returns the phase spectrum with unwrapping.

noverlap : int, default: 128
    The number of points of overlap between blocks.

scale : {'default', 'linear', 'dB'}
    The scaling of the values in the *spec*.  'linear' is no scaling.
    'dB' returns the values in dB scale.  When *mode* is 'psd',
    this is dB power (10 * log10).  Otherwise, this is dB amplitude
    (20 * log10). 'default' is 'dB' if *mode* is 'psd' or
    'magnitude' and 'linear' otherwise.  This must be 'linear'
    if *mode* is 'angle' or 'phase'.

Fc : int, default: 0
    The center frequency of *x*, which offsets the x extents of the
    plot to reflect the frequency range used when a signal is acquired
    and then filtered and downsampled to baseband.

cmap : `.Colormap`, default: :rc:`image.cmap`

xextent : *None* or (xmin, xmax)
    The image extent along the x-axis. The default sets *xmin* to the
    left border of the first bin (*spectrum* column) and *xmax* to the
    right border of the last bin. Note that for *noverlap>0* the width
    of the bins is smaller than those of the segments.

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

vmin, vmax : float, optional
    vmin and vmax define the data range that the colormap covers.
    By default, the colormap covers the complete value range of the
    data.

**kwargs
    Additional keyword arguments are passed on to `~.axes.Axes.imshow`
    which makes the specgram image. The origin keyword argument
    is not supported.

Returns
-------
spectrum : 2D array
    Columns are the periodograms of successive segments.

freqs : 1-D array
    The frequencies corresponding to the rows in *spectrum*.

t : 1-D array
    The times corresponding to midpoints of segments (i.e., the columns
    in *spectrum*).

im : `.AxesImage`
    The image created by imshow containing the spectrogram.

See Also
--------
psd
    Differs in the default overlap; in returning the mean of the
    segment periodograms; in not returning times; and in generating a
    line plot instead of colormap.
magnitude_spectrum
    A single spectrum, similar to having a single segment when *mode*
    is 'magnitude'. Plots a line instead of a colormap.
angle_spectrum
    A single spectrum, similar to having a single segment when *mode*
    is 'angle'. Plots a line instead of a colormap.
phase_spectrum
    A single spectrum, similar to having a single segment when *mode*
    is 'phase'. Plots a line instead of a colormap.

Notes
-----
The parameters *detrend* and *scale_by_freq* do only apply when *mode*
is set to 'psd'.
rY  r      r  complexzCannot plot a complex specgramrD   )anglephaser   r4  z,Cannot use dB scale with angle or phase mode)
r   r,  r.  r  r/  r0  r1  r2  r3  r  r7  r  rK  zUnknown scale r  rw  specgramupper)r
  r  r  rw  r4   )r   r6  rd  r  r  flipudrH  rI  r   kwarg_errorr  r   )r(   r   r,  r.  r<  r  r/  r0  r  xextentr1  r2  r3  r  rJ  r  r  rC   rM  r?  r   rO  pad_xextentr   r   r
  r  s                              r   rd  Axes.specgram  s   T <D:BH:B9=>>=EY.)) ''ETMKLL"/608-25B,02eQ HAd]|ty0DEM"((4.("((4.(~eY788IIaL?=B.2KffQi+-rvvay;/FFG
dtU1XuRy0v"":x88[[D 3d '3+13		&UAr!!r   	precisionc                 \   Uc  Uc  [        US5      (       a  Sn[        R                  " SS/US9  Uc  Uc  [        R                  " U5      n[        R
                  " U5      U:  nSU;  a  [        R                  " SS/S	S
9US'   SU;   a  [        R                  " SS5      eSU;  a  [        R                  " 5       US'   U R                  " U4SXVS.UD6n	GO[        US5      (       aq  UR                  5       n
US:X  a  U
R                  nU
R                  nO[        R
                  " U
R                  5      U:  nU
R                  U   nU
R                  U   nOG[        R                  " U5      n[        R
                  " U5      U:  n[        R                  " U5      u  pUc  SnUc  SnSU;   a  [        R                  " SS5      e[         R"                  " X4SX4S.UD6n	U R%                  U	5        UR&                  u  pU R)                  SUS-
  5        US:X  a  U R+                  US-
  S5        OU R+                  SUS-
  5        U R-                  U5        U R.                  R1                  S5        US:X  a  U R2                  R5                  5         OU R2                  R7                  5         U R2                  R9                  S5        U R2                  R;                  [<        R>                  " S/ SQSS95        U R@                  R;                  [<        R>                  " S/ SQSS95        U	$ )a	  
Plot the sparsity pattern of a 2D array.

This visualizes the non-zero values of the array.

Two plotting styles are available: image and marker. Both
are available for full arrays, but only the marker style
works for `scipy.sparse.spmatrix` instances.

**Image style**

If *marker* and *markersize* are *None*, `~.Axes.imshow` is used. Any
extra remaining keyword arguments are passed to this method.

**Marker style**

If *Z* is a `scipy.sparse.spmatrix` or *marker* or *markersize* are
*None*, a `.Line2D` object will be returned with the value of marker
determining the marker type, and any remaining keyword arguments
passed to `~.Axes.plot`.

Parameters
----------
Z : (M, N) array-like
    The array to be plotted.

precision : float or 'present', default: 0
    If *precision* is 0, any non-zero value will be plotted. Otherwise,
    values of :math:`|Z| > precision` will be plotted.

    For `scipy.sparse.spmatrix` instances, you can also
    pass 'present'. In this case any value present in the array
    will be plotted, even if it is identically zero.

aspect : {'equal', 'auto', None} or float, default: 'equal'
    The aspect ratio of the Axes.  This parameter is particularly
    relevant for images since it determines whether data pixels are
    square.

    This parameter is a shortcut for explicitly calling
    `.Axes.set_aspect`. See there for further details.

    - 'equal': Ensures an aspect ratio of 1. Pixels will be square.
    - 'auto': The Axes is kept fixed and the aspect is adjusted so
      that the data fit in the Axes. In general, this will result in
      non-square pixels.
    - *None*: Use :rc:`image.aspect`.

origin : {'upper', 'lower'}, default: :rc:`image.origin`
    Place the [0, 0] index of the array in the upper left or lower left
    corner of the Axes. The convention 'upper' is typically used for
    matrices and images.

Returns
-------
`~matplotlib.image.AxesImage` or `.Line2D`
    The return type depends on the plotting style (see above).

Other Parameters
----------------
**kwargs
    The supported additional parameters depend on the plotting style.

    For the image style, you can pass the following additional
    parameters of `~.Axes.imshow`:

    - *cmap*
    - *alpha*
    - *url*
    - any `.Artist` properties (passed on to the `.AxesImage`)

    For the marker style, you can pass any `.Line2D` property except
    for *linestyle*:

    %(Line2D:kwdoc)s
tocoor   re  r&   )rw  r  r  ry  binary)r   rv  spyr  r  )rv  ru  rw  presentr  r9  r  )r9  r  r  r  rq   ?both	   r  r  r\   r  Tr3  stepsr  )!r@  r   r  r  rA  r  rB  ListedColormaprg  NoNormr  rm  rowr=  rX  r'  r   r   r   r  r  r  rp  r#   set_yr  tick_toptick_bottomset_ticks_positionrr  rp  MaxNLocatorr  )r(   rO  rk  r  r  ru  rw  rC   r  r  r  r,   r   r'  r  r  s                   r   ro  Axes.spya   s   ` >j0WQ5H5HFGW-f=>j0

1A66!9y(DV#!(!7!7c
=E"Gv&(&&uo>>V#!(!1v++d ()%+( &(C q'""GGI	)AA ffQVVny8GgAgAJJqM&&)i/zz'*~!
f$&&uk::-- &vC MM#WWFBMM$S) b3h-dBH-OOF#

WJJ!JJ""$

%%f-

$$a}dK	M

$$a}dK	M
r   c                    [         R                  " U5      nSSSS.UEnU R                  " U40 UD6nU R                  R	                  S5        U R
                  R                  5         U R
                  R                  S5        U R
                  R                  [        R                  " S/ SQS	S
95        U R                  R                  [        R                  " S/ SQS	S
95        U$ )a  
Plot the values of a 2D matrix or array as color-coded image.

The matrix will be shown the way it would be printed, with the first
row at the top.  Row and column numbering is zero-based.

Parameters
----------
Z : (M, N) array-like
    The matrix to be displayed.

Returns
-------
`~matplotlib.image.AxesImage`

Other Parameters
----------------
**kwargs : `~matplotlib.axes.Axes.imshow` arguments

See Also
--------
imshow : More general function to plot data on a 2D regular raster.

Notes
-----
This is just a convenience function wrapping `.imshow` to set useful
defaults for displaying a matrix. In particular:

- Set ``origin='upper'``.
- Set ``interpolation='nearest'``.
- Set ``aspect='equal'``.
- Ticks are placed to the left and above.
- Ticks are formatted to show integer indices.

re  r  r_  )rw  rv  ru  rq  rr  rs  rt  Tru  )r  r>  r  r#   rz  r  r{  r}  rr  rp  r~  r  )r(   rO  rC   kwr  s        r   matshowAxes.matshow   s    H MM!(  [[!b!





%%f-

$$a}dK	M

$$a}dK	M	r   r  datasetc                 b   ^ U4S jn[         R                  " XU
U	S9nU R                  XUXEXgXS9	$ )a  
Make a violin plot.

Make a violin plot for each column of *dataset* or each vector in
sequence *dataset*.  Each filled area extends to represent the
entire data range, with optional lines at the mean, the median,
the minimum, the maximum, and user-specified quantiles.

Parameters
----------
dataset : Array or a sequence of vectors.
    The input data.

positions : array-like, default: [1, 2, ..., n]
    The positions of the violins; i.e. coordinates on the x-axis for
    vertical violins (or y-axis for horizontal violins).

vert : bool, optional
    .. deprecated:: 3.10
        Use *orientation* instead.

        If this is given during the deprecation period, it overrides
        the *orientation* parameter.

    If True, plots the violins vertically.
    If False, plots the violins horizontally.

orientation : {'vertical', 'horizontal'}, default: 'vertical'
    If 'horizontal', plots the violins horizontally.
    Otherwise, plots the violins vertically.

    .. versionadded:: 3.10

widths : float or array-like, default: 0.5
    The maximum width of each violin in units of the *positions* axis.
    The default is 0.5, which is half the available space when using default
    *positions*.

showmeans : bool, default: False
    Whether to show the mean with a line.

showextrema : bool, default: True
    Whether to show extrema with a line.

showmedians : bool, default: False
    Whether to show the median with a line.

quantiles : array-like, default: None
    If not None, set a list of floats in interval [0, 1] for each violin,
    which stands for the quantiles that will be rendered for that
    violin.

points : int, default: 100
    The number of points to evaluate each of the gaussian kernel density
    estimations at.

bw_method : {'scott', 'silverman'} or float or callable, default: 'scott'
    The method used to calculate the estimator bandwidth.  If a
    float, this will be used directly as `kde.factor`.  If a
    callable, it should take a `matplotlib.mlab.GaussianKDE` instance as
    its only parameter and return a float.

side : {'both', 'low', 'high'}, default: 'both'
    'both' plots standard violins. 'low'/'high' only
    plots the side below/above the positions value.

data : indexable object, optional
    DATA_PARAMETER_PLACEHOLDER

Returns
-------
dict
    A dictionary mapping each component of the violinplot to a
    list of the corresponding collection instances created. The
    dictionary has the following keys:

    - ``bodies``: A list of the `~.collections.PolyCollection`
      instances containing the filled area of each violin.

    - ``cmeans``: A `~.collections.LineCollection` instance that marks
      the mean values of each of the violin's distribution.

    - ``cmins``: A `~.collections.LineCollection` instance that marks
      the bottom of each violin's distribution.

    - ``cmaxes``: A `~.collections.LineCollection` instance that marks
      the top of each violin's distribution.

    - ``cbars``: A `~.collections.LineCollection` instance that marks
      the centers of each violin's distribution.

    - ``cmedians``: A `~.collections.LineCollection` instance that
      marks the median values of each of the violin's distribution.

    - ``cquantiles``: A `~.collections.LineCollection` instance created
      to identify the quantile values of each of the violin's
      distribution.

See Also
--------
.Axes.violin : Draw a violin from pre-computed statistics.
boxplot : Draw a box and whisker plot.
c                    > [         R                  " U 5      n [        R                  " U S   U :H  5      (       a  U S   U:H  R	                  [
        5      $ [        R                  " U T5      nUR                  U5      $ rG  )	r9   _unpack_to_numpyr  rg  r  r<   r6  GaussianKDEevaluate)rB  r  kde	bw_methods      r   _kde_method$Axes.violinplot.<locals>._kde_method!  sd    &&q)Avvadai  !..u55""1i0C<<''r   )points	quantiles)r-  r  r,  r  r  showextremashowmediansside)r9   violin_statsviolin)r(   r  r-  r  r,  r  r  r  r  r  r  r  r  r  vpstatss              `   r   
violinplotAxes.violinplot !  sE    \	( $$W&/8:{{7d'2%.'2  ? 	?r   c
           
         / n
/ n/ n/ n/ n/ n0 n[        U5      nSnUb"  [        R                  " SSSSS9  U(       a  SOSn[        R                  " SS/US	9  Uc  [	        S
US
-   5      nO)[        U5      U:w  a  [        UR                  S5      5      e[        R                  " U5      (       a  U/U-  nO)[        U5      U:w  a  [        UR                  S5      5      e[        R                  " / SQU	S9  U	S;   a  SOS/U	S;   a  SOS//[        R                  " U5      -  U-   n[        R                  S   (       a  SnSnOU R                  R                  5       =nnUS:X  a  U R                  nU	S;   aA  [        R                   " U R"                  USS9n[        R                   " U R$                  USS9nO[        R                   " U R"                  US9n[        R                   " U R$                  US9nOU R&                  nU	S;   aA  [        R                   " U R$                  USS9n[        R                   " U R"                  USS9nO>[        R                   " U R$                  US9n[        R                   " U R"                  US9n/ n[)        XU5       H  u  nnn[        R                  " US   5      nSU-  U-  UR+                  5       -  nUU" US   U	S;   a  U* U-   OUU	S;   a  UU-   OUUSS9/-  nU
R-                  US    5        UR-                  US!   5        UR-                  US"   5        UR-                  US#   5        UR/                  S$5      nUc  / nUR1                  U5        UR-                  [        U5      5        M     UUS%'   U(       a  U" U
/UQ76 US&'   U(       a$  U" U/UQ76 US''   U" U/UQ76 US('   U" X+U5      US)'   U(       a  U" U/UQ76 US*'   U(       a   U" U/[        R2                  " UUS
S+9Q76 US,'   U$ )-a  
Draw a violin plot from pre-computed statistics.

Draw a violin plot for each column of *vpstats*. Each filled area
extends to represent the entire data range, with optional lines at the
mean, the median, the minimum, the maximum, and the quantiles values.

Parameters
----------
vpstats : list of dicts
    A list of dictionaries containing stats for each violin plot.
    Required keys are:

    - ``coords``: A list of scalars containing the coordinates that
      the violin's kernel density estimate were evaluated at.

    - ``vals``: A list of scalars containing the values of the
      kernel density estimate at each of the coordinates given
      in *coords*.

    - ``mean``: The mean value for this violin's dataset.

    - ``median``: The median value for this violin's dataset.

    - ``min``: The minimum value for this violin's dataset.

    - ``max``: The maximum value for this violin's dataset.

    Optional keys are:

    - ``quantiles``: A list of scalars containing the quantile values
      for this violin's dataset.

positions : array-like, default: [1, 2, ..., n]
    The positions of the violins; i.e. coordinates on the x-axis for
    vertical violins (or y-axis for horizontal violins).

vert : bool, optional
    .. deprecated:: 3.10
        Use *orientation* instead.

        If this is given during the deprecation period, it overrides
        the *orientation* parameter.

    If True, plots the violins vertically.
    If False, plots the violins horizontally.

orientation : {'vertical', 'horizontal'}, default: 'vertical'
    If 'horizontal', plots the violins horizontally.
    Otherwise, plots the violins vertically.

    .. versionadded:: 3.10

widths : float or array-like, default: 0.5
    The maximum width of each violin in units of the *positions* axis.
    The default is 0.5, which is half available space when using default
    *positions*.

showmeans : bool, default: False
    Whether to show the mean with a line.

showextrema : bool, default: True
    Whether to show extrema with a line.

showmedians : bool, default: False
    Whether to show the median with a line.

side : {'both', 'low', 'high'}, default: 'both'
    'both' plots standard violins. 'low'/'high' only
    plots the side below/above the positions value.

Returns
-------
dict
    A dictionary mapping each component of the violinplot to a
    list of the corresponding collection instances created. The
    dictionary has the following keys:

    - ``bodies``: A list of the `~.collections.PolyCollection`
      instances containing the filled area of each violin.

    - ``cmeans``: A `~.collections.LineCollection` instance that marks
      the mean values of each of the violin's distribution.

    - ``cmins``: A `~.collections.LineCollection` instance that marks
      the bottom of each violin's distribution.

    - ``cmaxes``: A `~.collections.LineCollection` instance that marks
      the top of each violin's distribution.

    - ``cbars``: A `~.collections.LineCollection` instance that marks
      the centers of each violin's distribution.

    - ``cmedians``: A `~.collections.LineCollection` instance that
      marks the median values of each of the violin's distribution.

    - ``cquantiles``: A `~.collections.LineCollection` instance created
      to identify the quantiles values of each of the violin's
      distribution.

See Also
--------
violinplot :
    Draw a violin plot from data instead of pre-computed statistics.
zHList of violinplot statistics and `{0}` values must have the same lengthr?  r@  rA  TrB  r<  r1  r  r  r-  r  )rr  r  r  )r  )rr  r  g      пr   )rr  r  r\  rG  r,   r  )r  r  
projecting)r  capstyle)r  r   rq   r  g333333?)rr   rt   r>  rH  rI  r=  r  bodiescmeanscmaxescminscbarscmediansr  
cquantiles)r   r   rd  r  re  r   rf  r  ri  r6  r6   r7   r[  r  rs  	functoolspartialr'  r*  rm  r   rI  r   r   rn  r  )r(   r  r-  r  r,  r  r  r  r  r  rc  rP  rQ  rb  r  qlensr(  r  r  	line_ends	fillcolorrL  rV  
perp_lines	par_linesr  r&  r  r  r   rM  s                                  r   r  Axes.violin!  s&   ^ 	L@   !E	 )-*,KL*5;O aQI^q .55kBCC ;;vX\F[A.55h?@@ 	2>  $6eA>"&66dA>@HHV,-/89	
 <<01II$(OO$B$B$DDI	 *$%%D&&..t{{99EG
%--dkk)9EG	 '..t{{9M
%--dkk)L	$$D&&..t{{99EG
%--dkk)9EG	 '..t{{9M
%--dkk)L	 !$W!@E388E&M*D;%
2DtE(O+/?+BTECK*.2B*BD3J&/s< = =F LLv'KKe%LLu&NN5?+		+&AyQLLQ ! "A" # *5 =9 =GH *5 =9 =GH)$;;GG(%@GG",W"Ay"AGJ$.%AIIiQ?%AGL! r   )r   r,   urz  start_pointsc                     U R                  5       R                  5       nU R                  5       U-  u  p#X2-
  u  pEXTU R                  5       -  -  $ )z`
Convenience method to calculate the aspect ratio of the Axes in
the display coordinate system.
)rf   get_size_inchesget_positionget_data_ratio)r(   figure_sizellurr  r  s         r   _get_aspect_ratioAxes._get_aspect_ratio"  sN    
 oo'779""${2!4!4!6677r   )r8   rS   )r   )NNNrZ   )NN)NrX  NNN)r   r   r  r  )Nr  r  )r1  r  r  NNNr  )r  NTF)r  N)NNNNg333333?Fg?r   r  TNN)r   r   FF)NNr  NNNFFFFFr  N)NNNr<  NNNNNNNNNNNNNNNNNNNTFNNN)NNNr<  FFFTTTNNNNNNFTNNN)	NNNNNNNNN)r   )r   NFN)r   NNF)NNFNFNr  r  r<  NFNNF)r  NFNNN)
NNNNNNNNNN)NNNNNN)NNNNN)NNNNNNNNNNNNNNN)r   NNr_  re  )NNr<  rq   FTFNr  Nrr  )NNr<  rq   FTFrr  )tr   
__module__r   __firstlineno____doc__r*   rF   rN   r   interpdrW   rT   r`   r}   r   r   r   r   r   r   r   __init__r   r   staticmethodr   r   r   r   r   make_keyword_onlyr   r'  r*  rV  r\  
deprecatedrf  r}  r  r  r  r6  detrend_noner  r  r  r  r  r   r1  r>  rE  r  r  r  rename_parameterr)  r!  r  r  r  r>  r8  r<  r   r?  r@  rF  rI  rN  rR  rV  re  r_  rm  rf  rs  r  r  r  r  r  r  r  r  r  r  r  r*  r7  rD  rL  rR  rW  window_hanningr\  rd  ro  r  r  r  r   mtabletablemstack	stackplotmstream
streamplotmtri
tricontourtricontourf	tripcolortriplotr  __static_attributes__rb   r   r   r   r   C   s   0 2Tt Tl x xt /31 FP Pd!'5"P Pd&=P 3T 3 3j )T ) )V L L\ JN26  ''0088H P Pd P Pd 3 3 GT G GR 4 4l < <| 
E7+$C"%'<CW' ,Wr 
E7+$C"%'<CW' ,Wr 
E=1 %= > IJEI$o > 2
oj !%d { {z 
__U/S#JC@L.  A 0L.^ 2O 2Oj +F +F\ +F +FZ SEs;G* <G*R 
E8,S#JC@!%t/@/@bl# A -l#b ',$ B;H 1 1f0$d Bh B  BJ
 FXF FPeteN @  @D "&$QZ\ \| 
E9-$HI7;GJ154:&+	t, ;?d	t, J .t,l  > 
E8,$>"%'-1?C7<FJt" ' -t"l 
E7+	5(M:48=A:>158<8<?C<@;?&*X ;  ,Xt
 
E8,>BDIEI9=7;6:"&xA -xAt [% [%z 
E8, %< #&' IM=A[4u[ 	' -[z 
E:.OE!Cdxt$Tdv!#O  F /Ob % %N __W&&//0 1        $ 2j ,-hEhTI
 AFG ##3;;BB#3  C  
 $<(02L 04-2G ## 4 < < C C !D !
 %=)02M t!ttD#'DC$	t  tl 4: o b $(4dttY  Yv &*Dtdc  cJ &*DtF  FP        +, 
E7+S)$4#FDHBG6;-2jF G ,jFX ^%^ ^@ 
E7+$9:GK#i%  ; ,i%V S)$4#FbU#eb  GbH 
E6*SE*:>/38<k$  + +k$Z 
E6*S#JC@=A/38<b$  A +b$H 
E4(SE*=A:>R!  + )R!h 
E4(SE*9=*.A%  + )A%F 
E4(SE*9=*.A%  + )A%F 
E6*S#J/ #a9J9J))Add<  0 +<| 
E6*SE*?C'+=A6:!%	]"  + +]"~ 
E;/:>#*H  0HT1f 
E6*YK07;AFBF4:z? 1 +z?x 
E6*37=B9?[ +[~ fll+E !"#4V5E5E#FGI!>@',,-/J #4??3J#D$4$45K!$..1I-G8r   r   )cr  r  loggingrv  numbersr   r   r   r  numpyr  
matplotlibr6   matplotlib.categorymatplotlib.cbookr9   matplotlib.collectionscollectionsr  matplotlib.colorizerr  r  matplotlib.colorsr  rB  matplotlib.contourr  r  matplotlib.datesmatplotlib.imager  r~  matplotlib.insetinsetry   matplotlib.legendrW   rI   matplotlib.linesr  r   matplotlib.markersmarkersr  matplotlib.mlabr6  matplotlib.patchesr  r   matplotlib.pathrS  rN  matplotlib.quiverrN  r?  matplotlib.stackplotr  r  matplotlib.streamplotr  r  matplotlib.tabler  r  matplotlib.textr   r   matplotlib.tickertickerrp  matplotlib.transforms
transformsr   matplotlib.tritrir  matplotlib.unitsunitsr   r   r   r   matplotlib.axes._baser	   r
   r   matplotlib.axes._secondary_axesr   matplotlib.containerr   r   r   r   	getLoggerr   _logr   r  r   rb   r   r   <module>r     s        * * 	      & ) # %  ! ! # ! %  %  # % ' !  # +  ! 9 9@ @ 9 O O 1"$ PI89 PI8 PI8r   