Skip to content

Commit 3b1834a

Browse files
committed
DOC: Improve docs for plotting
1 parent 0b1d400 commit 3b1834a

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

pandas/plotting/_core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ def hist_frame(
266266
267267
Parameters
268268
----------
269+
%(data)s\
269270
column : str or list of str, optional
270271
Column name or list of names, or vector.
271272
Can be any valid input to :meth:`pandas.DataFrame.groupby`.
@@ -466,7 +467,7 @@ def hist_frame(
466467
"""
467468

468469

469-
@Substitution(backend="")
470+
@Substitution(data="data : DataFrame\n The data to visualize.\n", backend="")
470471
@Appender(_boxplot_doc)
471472
def boxplot(
472473
data: DataFrame,
@@ -497,7 +498,7 @@ def boxplot(
497498
)
498499

499500

500-
@Substitution(backend=_backend_doc)
501+
@Substitution(data="", backend=_backend_doc)
501502
@Appender(_boxplot_doc)
502503
def boxplot_frame(
503504
self,

pandas/plotting/_misc.py

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
)
2020

2121

22-
def table(ax, data, rowLabels=None, colLabels=None, **kwargs):
22+
def table(ax, data, **kwargs):
2323
"""
2424
Helper function to convert DataFrame and Series to matplotlib.table.
2525
@@ -285,14 +285,18 @@ def andrews_curves(
285285
----------
286286
frame : DataFrame
287287
Data to be plotted, preferably normalized to (0.0, 1.0).
288-
class_column : Name of the column containing class names
289-
ax : matplotlib axes object, default None
290-
samples : Number of points to plot in each curve
291-
color : list or tuple, optional
292-
Colors to use for the different classes.
288+
class_column : label
289+
Name of the column containing class names
290+
ax : axes object, default None
291+
Axes to use
292+
samples : int
293+
Number of points to plot in each curve
294+
color : {str, list, tuple}, optional
295+
Colors to use for the different classes. Colors can be strings
296+
or 3-element floating point RBG values.
293297
colormap : str or matplotlib colormap object, default None
294-
Colormap to select colors from. If string, load colormap with that name
295-
from matplotlib.
298+
Colormap to select colors from. If a string, load colormap with that
299+
name from matplotlib.
296300
**kwargs
297301
Options to pass to matplotlib plotting method.
298302
@@ -430,7 +434,7 @@ def parallel_coordinates(
430434
431435
Returns
432436
-------
433-
class:`matplotlib.axis.Axes`
437+
matplotlib.axis.Axes
434438
435439
Examples
436440
--------
@@ -470,19 +474,21 @@ def lag_plot(series: Series, lag: int = 1, ax: Axes | None = None, **kwds) -> Ax
470474
471475
Parameters
472476
----------
473-
series : Time series
474-
lag : lag of the scatter plot, default 1
477+
series : Series
478+
The time series to visualize.
479+
lag : int, optional
480+
lag of the scatter plot, default 1.
475481
ax : Matplotlib axis object, optional
482+
The matplotlib axis object to use.
476483
**kwds
477484
Matplotlib scatter method keyword arguments.
478485
479486
Returns
480487
-------
481-
class:`matplotlib.axis.Axes`
488+
matplotlib.axis.Axes
482489
483490
Examples
484491
--------
485-
486492
Lag plots are most commonly used to look for patterns in time series data.
487493
488494
Given the following time series
@@ -514,18 +520,19 @@ def autocorrelation_plot(series: Series, ax: Axes | None = None, **kwargs) -> Ax
514520
515521
Parameters
516522
----------
517-
series : Time series
523+
series : Series
524+
The time series to visualize.
518525
ax : Matplotlib axis object, optional
526+
The matplotlib axis object to use.
519527
**kwargs
520528
Options to pass to matplotlib plotting method.
521529
522530
Returns
523531
-------
524-
class:`matplotlib.axis.Axes`
532+
matplotlib.axis.Axes
525533
526534
Examples
527535
--------
528-
529536
The horizontal lines in the plot correspond to 95% and 99% confidence bands.
530537
531538
The dashed line is 99% confidence band.

0 commit comments

Comments
 (0)