@@ -43,6 +43,20 @@ def table(ax: Axes, data: DataFrame | Series, **kwargs) -> Table:
43
43
Returns
44
44
-------
45
45
matplotlib table object
46
+
47
+ Examples
48
+ --------
49
+
50
+ .. plot::
51
+ :context: close-figs
52
+
53
+ >>> import matplotlib.pyplot as plt
54
+ >>> df = pd.DataFrame({'A': [1, 2], 'B': [3, 4]})
55
+ >>> fix, ax = plt.subplots()
56
+ >>> ax.axis('off')
57
+ (0.0, 1.0, 0.0, 1.0)
58
+ >>> table = pd.plotting.table(ax, df, loc='center',
59
+ ... cellLoc='center', colWidths=list([.2, .2]))
46
60
"""
47
61
plot_backend = _get_plot_backend ("matplotlib" )
48
62
return plot_backend .table (
@@ -552,6 +566,21 @@ class _Options(dict):
552
566
Allows for parameter aliasing so you can just use parameter names that are
553
567
the same as the plot function parameters, but is stored in a canonical
554
568
format that makes it easy to breakdown into groups later.
569
+
570
+ Examples
571
+ --------
572
+
573
+ .. plot::
574
+ :context: close-figs
575
+
576
+ >>> np.random.seed(42)
577
+ >>> df = pd.DataFrame({'A': np.random.randn(10),
578
+ ... 'B': np.random.randn(10)},
579
+ ... index=pd.date_range("1/1/2000",
580
+ ... freq='4MS', periods=10))
581
+ >>> with pd.plotting.plot_params.use("x_compat", True):
582
+ ... _ = df["A"].plot(color="r")
583
+ ... _ = df["B"].plot(color="g")
555
584
"""
556
585
557
586
# alias so the names are same as plotting method parameter names
0 commit comments