diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 8d6c2062f9484..17befb3d27da4 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -266,6 +266,7 @@ def hist_frame( Parameters ---------- +%(data)s\ column : str or list of str, optional Column name or list of names, or vector. Can be any valid input to :meth:`pandas.DataFrame.groupby`. @@ -276,7 +277,7 @@ def hist_frame( The matplotlib axes to be used by boxplot. fontsize : float or str Tick label font size in points or as a string (e.g., `large`). -rot : int or float, default 0 +rot : float, default 0 The rotation angle of labels (in degrees) with respect to the screen coordinate system. grid : bool, default True @@ -466,7 +467,7 @@ def hist_frame( """ -@Substitution(backend="") +@Substitution(data="data : DataFrame\n The data to visualize.\n", backend="") @Appender(_boxplot_doc) def boxplot( data: DataFrame, @@ -497,7 +498,7 @@ def boxplot( ) -@Substitution(backend=_backend_doc) +@Substitution(data="", backend=_backend_doc) @Appender(_boxplot_doc) def boxplot_frame( self, @@ -556,7 +557,7 @@ def boxplot_frame_groupby( column : column name or list of names, or vector Can be any valid input to groupby. - fontsize : int or str + fontsize : float or str rot : label rotation angle grid : Setting this to True will show the grid ax : Matplotlib axis object, default None @@ -730,10 +731,10 @@ class PlotAccessor(PandasObject): Now applicable to planar plots (`scatter`, `hexbin`). - rot : int, default None + rot : float, default None Rotation for ticks (xticks for vertical, yticks for horizontal plots). - fontsize : int, default None + fontsize : float, default None Font size for xticks and yticks. colormap : str or matplotlib colormap object, default None Colormap to select colors from. If string, load colormap with that diff --git a/pandas/plotting/_matplotlib/hist.py b/pandas/plotting/_matplotlib/hist.py index cad03b1923e9d..2106e05a817ce 100644 --- a/pandas/plotting/_matplotlib/hist.py +++ b/pandas/plotting/_matplotlib/hist.py @@ -323,7 +323,7 @@ def _grouped_hist( layout : optional sharex : bool, default False sharey : bool, default False - rot : int, default 90 + rot : float, default 90 grid : bool, default True legend: : bool, default False kwargs : dict, keyword arguments passed to matplotlib.Axes.hist diff --git a/pandas/plotting/_misc.py b/pandas/plotting/_misc.py index 4f197b5fc7095..9dbf43c5d70c5 100644 --- a/pandas/plotting/_misc.py +++ b/pandas/plotting/_misc.py @@ -19,7 +19,7 @@ ) -def table(ax, data, rowLabels=None, colLabels=None, **kwargs): +def table(ax, data, **kwargs): """ Helper function to convert DataFrame and Series to matplotlib.table. @@ -285,14 +285,18 @@ def andrews_curves( ---------- frame : DataFrame Data to be plotted, preferably normalized to (0.0, 1.0). - class_column : Name of the column containing class names - ax : matplotlib axes object, default None - samples : Number of points to plot in each curve - color : list or tuple, optional - Colors to use for the different classes. + class_column : label + Name of the column containing class names. + ax : axes object, default None + Axes to use. + samples : int + Number of points to plot in each curve. + color : str, list[str] or tuple[str], optional + Colors to use for the different classes. Colors can be strings + or 3-element floating point RBG values. colormap : str or matplotlib colormap object, default None - Colormap to select colors from. If string, load colormap with that name - from matplotlib. + Colormap to select colors from. If a string, load colormap with that + name from matplotlib. **kwargs Options to pass to matplotlib plotting method. @@ -430,7 +434,7 @@ def parallel_coordinates( Returns ------- - class:`matplotlib.axis.Axes` + matplotlib.axis.Axes Examples -------- @@ -470,19 +474,21 @@ def lag_plot(series: Series, lag: int = 1, ax: Axes | None = None, **kwds) -> Ax Parameters ---------- - series : Time series - lag : lag of the scatter plot, default 1 + series : Series + The time series to visualize. + lag : int, default 1 + Lag length of the scatter plot. ax : Matplotlib axis object, optional + The matplotlib axis object to use. **kwds Matplotlib scatter method keyword arguments. Returns ------- - class:`matplotlib.axis.Axes` + matplotlib.axis.Axes Examples -------- - Lag plots are most commonly used to look for patterns in time series data. Given the following time series @@ -514,18 +520,19 @@ def autocorrelation_plot(series: Series, ax: Axes | None = None, **kwargs) -> Ax Parameters ---------- - series : Time series + series : Series + The time series to visualize. ax : Matplotlib axis object, optional + The matplotlib axis object to use. **kwargs Options to pass to matplotlib plotting method. Returns ------- - class:`matplotlib.axis.Axes` + matplotlib.axis.Axes Examples -------- - The horizontal lines in the plot correspond to 95% and 99% confidence bands. The dashed line is 99% confidence band.