diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 702e7d28a36d8..44d61658ec036 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -79,9 +79,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.io.stata.StataReader.variable_labels \ pandas.io.stata.StataWriter.write_file \ pandas.plotting.deregister_matplotlib_converters \ - pandas.plotting.plot_params \ pandas.plotting.register_matplotlib_converters \ - pandas.plotting.table \ pandas.util.hash_array \ pandas.util.hash_pandas_object \ pandas_object \ diff --git a/pandas/plotting/_misc.py b/pandas/plotting/_misc.py index 4c12a7ad01537..f862e49071cae 100644 --- a/pandas/plotting/_misc.py +++ b/pandas/plotting/_misc.py @@ -43,6 +43,20 @@ def table(ax: Axes, data: DataFrame | Series, **kwargs) -> Table: 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])) """ plot_backend = _get_plot_backend("matplotlib") return plot_backend.table( @@ -552,6 +566,21 @@ class _Options(dict): Allows for parameter aliasing so you can just use parameter names that are the same as the plot function parameters, but is stored in a canonical format that makes it easy to breakdown into groups later. + + Examples + -------- + + .. plot:: + :context: close-figs + + >>> np.random.seed(42) + >>> df = pd.DataFrame({'A': np.random.randn(10), + ... 'B': np.random.randn(10)}, + ... index=pd.date_range("1/1/2000", + ... freq='4MS', periods=10)) + >>> with pd.plotting.plot_params.use("x_compat", True): + ... _ = df["A"].plot(color="r") + ... _ = df["B"].plot(color="g") """ # alias so the names are same as plotting method parameter names