
    ch                        S r SSKJr  SSKrSSKJrJrJr  SSKJ	r	  SSK
JrJr  SSKJr  SSKJr  \(       a  SS	KJr  SS
KJr   " S S5      r   S             SS jjrg)z/Streamlit support for Matplotlib PyPlot charts.    )annotationsN)TYPE_CHECKINGAnycast)show_deprecation_warning)WidthBehaviormarshall_images)	ImageList)gather_metrics)Figure)DeltaGeneratorc                  d    \ rS rSr\" S5         S         SS jj5       r\S	S j5       rSrg)
PyplotMixin!   pyplotNc                    U(       d  [        S5        [        5       n[        U R                  R	                  5       UUUU40 UD6  U R                  R                  SU5      $ )aU  Display a matplotlib.pyplot figure.

.. Important::
    You must install ``matplotlib>=3.0.0`` to use this command. You can
    install all charting dependencies (except Bokeh) as an extra with
    Streamlit:

    >>> pip install streamlit[charts]

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 matplotlib.pyplot as plt
>>> import streamlit as st
>>> from numpy.random import default_rng as rng
>>>
>>> arr = rng(0).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.

a%  
Calling `st.pyplot()` without providing a figure argument has been deprecated
and will be removed in a later version as it requires the use of Matplotlib's
global figure object, which is not thread-safe.

To future-proof this code, you should pass in a figure as shown below:

```python
fig, ax = plt.subplots()
ax.scatter([1, 2, 3], [1, 2, 3])
# other plotting actions...
st.pyplot(fig)
```

If you have a specific use case that requires this functionality, please let us
know via [issue on Github](https://github.com/streamlit/streamlit/issues).
imgs)r   ImageListProtomarshalldg_get_delta_path_str_enqueue)selffigclear_figureuse_container_widthkwargsimage_list_protos         lC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\streamlit/elements/pyplot.pyr   PyplotMixin.pyplot"   sh    V $ & $ *+GG'')	
 	
 ww(899    c                    [        SU 5      $ )zGet our DeltaGenerator.r   )r   )r   s    r   r   PyplotMixin.dg   s     $d++r!    )NNT)
r   Figure | Noner   bool | Noner   boolr   r   returnr   )r(   r   )	__name__
__module____qualname____firstlineno__r   r   propertyr   __static_attributes__r$   r!   r   r   r   !   sp    H "$($(	f:f: "f: "	f:
 f: 
f: f:P , ,r!   r   c                "    SS K Jn  UR                  5         U(       d  Uc  Sn[	        SU5      nSSSS.nUR                  5        VV	s0 s H  u  pXR                  X5      _M     nnn	UR                  U5        [        R                  " 5       n
UR                  " U
40 UD6  U(       a  [        R                  O[        R                  n[        U U
S UUS	S
SS9  U(       a  UR                  5         g g ! [         a    [        S5      ef = fs  sn	nf )Nr   z$pyplot() command requires matplotlibTr   tight   png)bbox_inchesdpiformatFRGBPNG)coordinatesimagecaptionwidth
proto_imgsclampchannelsoutput_format)matplotlib.pyplotr   ioffImportErrorr   itemsgetupdateioBytesIOsavefigr   COLUMNORIGINALr	   clf)r8   r   r   r   r   r   pltoptionsabr9   image_widths               r   r   r      s   B'
 L8S!
 &cUCG 07}}?tqq**Q""G?
MM'JJLEKK   39O9O  #	 	 Q  B@AAB$ @s   C2 	D2D)NTT)r8   strr   r   r   r%   r   r&   r   r'   r   r   r(   None)__doc__
__future__r   rF   typingr   r   r   streamlit.deprecation_utilr   "streamlit.elements.lib.image_utilsr   r	   streamlit.proto.Image_pb2r
   r   streamlit.runtime.metrics_utilr   matplotlib.figurer   streamlit.delta_generatorr   r   r   r$   r!   r   <module>r\      s    6 " 	 + + ? M A 9(8m, m,f  $ $55$5 
5 	5
 5 5 
5r!   