Sindbad~EG File Manager
�
Mٜg�Q � �� � d dl mZ d dlmZ d dlmZmZ d dlmZ er,d dl m
Z
mZ d dlm
Z
d dlmZ d dlmZ d d lmZ d d
lZd dlmZmZ dd�Zdd
�Zdd�Z d dd�Z d dd�Z d dd�Z d d!d�Z d" d#d�Z d$d%d�Z!d&d'd�Z" G d� de#� Z$ e$� Z%y
)(� )�annotations)�contextmanager)�
TYPE_CHECKING�Any)�_get_plot_backend)� Generator�Mapping)�Axes)�Colormap)�Figure)�TableN)� DataFrame�Seriesc �F � t d� } |j d| |ddd�|��S )ar
Helper function to convert DataFrame and Series to matplotlib.table.
Parameters
----------
ax : Matplotlib axes object
data : DataFrame or Series
Data for table contents.
**kwargs
Keyword arguments to be passed to matplotlib.table.table.
If `rowLabels` or `colLabels` is not specified, data index or column
name will be used.
Returns
-------
matplotlib table object
Examples
--------
.. plot::
:context: close-figs
>>> import matplotlib.pyplot as plt
>>> df = pd.DataFrame({'A': [1, 2], 'B': [3, 4]})
>>> fix, ax = plt.subplots()
>>> ax.axis('off')
(0.0, 1.0, 0.0, 1.0)
>>> table = pd.plotting.table(ax, df, loc='center',
... cellLoc='center', colWidths=list([.2, .2]))
�
matplotlibN)�ax�data� rowLabels� colLabels� )r �table)r r �kwargs�plot_backends �@/usr/local/lib/python3.12/site-packages/pandas/plotting/_misc.pyr r s: � �@ %�\�2�L��<��� �
�D�D�D��<B�� � c �: � t d� } | j � y)a�
Register pandas formatters and converters with matplotlib.
This function modifies the global ``matplotlib.units.registry``
dictionary. pandas adds custom converters for
* pd.Timestamp
* pd.Period
* np.datetime64
* datetime.datetime
* datetime.date
* datetime.time
See Also
--------
deregister_matplotlib_converters : Remove pandas formatters and converters.
Examples
--------
.. plot::
:context: close-figs
The following line is done automatically by pandas so
the plot can be rendered:
>>> pd.plotting.register_matplotlib_converters()
>>> df = pd.DataFrame({'ts': pd.period_range('2020', periods=2, freq='M'),
... 'y': [1, 2]
... })
>>> plot = df.plot.line(x='ts', y='y')
Unsetting the register manually an error will be raised:
>>> pd.set_option("plotting.matplotlib.register_converters",
... False) # doctest: +SKIP
>>> df.plot.line(x='ts', y='y') # doctest: +SKIP
Traceback (most recent call last):
TypeError: float() argument must be a string or a real number, not 'Period'
r N)r �register�r s r r r C s � �R %�\�2�L����r c �: � t d� } | j � y)a9
Remove pandas formatters and converters.
Removes the custom converters added by :func:`register`. This
attempts to set the state of the registry back to the state before
pandas registered its own units. Converters for pandas' own types like
Timestamp and Period are removed completely. Converters for types
pandas overwrites, like ``datetime.datetime``, are restored to their
original value.
See Also
--------
register_matplotlib_converters : Register pandas formatters and converters
with matplotlib.
Examples
--------
.. plot::
:context: close-figs
The following line is done automatically by pandas so
the plot can be rendered:
>>> pd.plotting.register_matplotlib_converters()
>>> df = pd.DataFrame({'ts': pd.period_range('2020', periods=2, freq='M'),
... 'y': [1, 2]
... })
>>> plot = df.plot.line(x='ts', y='y')
Unsetting the register manually an error will be raised:
>>> pd.set_option("plotting.matplotlib.register_converters",
... False) # doctest: +SKIP
>>> df.plot.line(x='ts', y='y') # doctest: +SKIP
Traceback (most recent call last):
TypeError: float() argument must be a string or a real number, not 'Period'
r N)r �
deregisterr s r r r p s � �N %�\�2�L����r c
�R � t d� } |j d| ||||||||| d�
|
��S )a�
Draw a matrix of scatter plots.
Parameters
----------
frame : DataFrame
alpha : float, optional
Amount of transparency applied.
figsize : (float,float), optional
A tuple (width, height) in inches.
ax : Matplotlib axis object, optional
grid : bool, optional
Setting this to True will show the grid.
diagonal : {'hist', 'kde'}
Pick between 'kde' and 'hist' for either Kernel Density Estimation or
Histogram plot in the diagonal.
marker : str, optional
Matplotlib marker type, default '.'.
density_kwds : keywords
Keyword arguments to be passed to kernel density estimate plot.
hist_kwds : keywords
Keyword arguments to be passed to hist function.
range_padding : float, default 0.05
Relative extension of axis range in x and y with respect to
(x_max - x_min) or (y_max - y_min).
**kwargs
Keyword arguments to be passed to scatter function.
Returns
-------
numpy.ndarray
A matrix of scatter plots.
Examples
--------
.. plot::
:context: close-figs
>>> df = pd.DataFrame(np.random.randn(1000, 4), columns=['A','B','C','D'])
>>> pd.plotting.scatter_matrix(df, alpha=0.2)
array([[<Axes: xlabel='A', ylabel='A'>, <Axes: xlabel='B', ylabel='A'>,
<Axes: xlabel='C', ylabel='A'>, <Axes: xlabel='D', ylabel='A'>],
[<Axes: xlabel='A', ylabel='B'>, <Axes: xlabel='B', ylabel='B'>,
<Axes: xlabel='C', ylabel='B'>, <Axes: xlabel='D', ylabel='B'>],
[<Axes: xlabel='A', ylabel='C'>, <Axes: xlabel='B', ylabel='C'>,
<Axes: xlabel='C', ylabel='C'>, <Axes: xlabel='D', ylabel='C'>],
[<Axes: xlabel='A', ylabel='D'>, <Axes: xlabel='B', ylabel='D'>,
<Axes: xlabel='C', ylabel='D'>, <Axes: xlabel='D', ylabel='D'>]],
dtype=object)
r )
�frame�alpha�figsizer �grid�diagonal�marker�density_kwds� hist_kwds�
range_paddingr )r �scatter_matrix)r"