"""
This type stub file was generated by pyright.
"""

from typing import Any, TYPE_CHECKING
from streamlit.proto.Image_pb2 import ImageList as ImageListProto
from streamlit.runtime.metrics_util import gather_metrics
from matplotlib.figure import Figure
from streamlit.delta_generator import DeltaGenerator

"""Streamlit support for Matplotlib PyPlot charts."""
if TYPE_CHECKING:
    ...
class PyplotMixin:
    @gather_metrics("pyplot")
    def pyplot(self, fig: Figure | None = ..., clear_figure: bool | None = ..., use_container_width: bool = ..., **kwargs: Any) -> DeltaGenerator:
        """Display a matplotlib.pyplot figure.

        .. Important::
            You must install ``matplotlib`` to use this command.

        Parameters
        ----------
        fig : Matplotlib Figure
            The Matplotlib ``Figure`` object to render. See
            https://matplotlib.org/stable/gallery/index.html for examples.

            .. note::
                When this argument isn't specified, this function will render the global
                Matplotlib figure object. However, this feature is deprecated and
                will be removed in a later version.

        clear_figure : bool
            If True, the figure will be cleared after being rendered.
            If False, the figure will not be cleared after being rendered.
            If left unspecified, we pick a default based on the value of ``fig``.

            - If ``fig`` is set, defaults to ``False``.

            - If ``fig`` is not set, defaults to ``True``. This simulates Jupyter's
              approach to matplotlib rendering.

        use_container_width : bool
            Whether to override the figure's native width with the width of
            the parent container. If ``use_container_width`` is ``True``
            (default), Streamlit sets the width of the figure to match the
            width of the parent container. If ``use_container_width`` is
            ``False``, Streamlit sets the width of the chart to fit its
            contents according to the plotting library, up to the width of the
            parent container.

        **kwargs : any
            Arguments to pass to Matplotlib's savefig function.

        Example
        -------
        >>> import streamlit as st
        >>> import matplotlib.pyplot as plt
        >>> import numpy as np
        >>>
        >>> arr = np.random.normal(1, 1, size=100)
        >>> fig, ax = plt.subplots()
        >>> ax.hist(arr, bins=20)
        >>>
        >>> st.pyplot(fig)

        .. output::
           https://doc-pyplot.streamlit.app/
           height: 630px

        Matplotlib supports several types of "backends". If you're getting an
        error using Matplotlib with Streamlit, try setting your backend to "TkAgg"::

            echo "backend: TkAgg" >> ~/.matplotlib/matplotlibrc

        For more information, see https://matplotlib.org/faq/usage_faq.html.

        """
        ...
    
    @property
    def dg(self) -> DeltaGenerator:
        """Get our DeltaGenerator."""
        ...
    


def marshall(coordinates: str, image_list_proto: ImageListProto, fig: Figure | None = ..., clear_figure: bool | None = ..., use_container_width: bool = ..., **kwargs: Any) -> None:
    ...

