diff --git a/pandas/plotting/_misc.py b/pandas/plotting/_misc.py index a8e86d9dfa997..76a1861ee0407 100644 --- a/pandas/plotting/_misc.py +++ b/pandas/plotting/_misc.py @@ -14,9 +14,9 @@ def table(ax, data, rowLabels=None, colLabels=None, **kwargs): ---------- ax : Matplotlib axes object data : DataFrame or Series - data for table contents - kwargs : keywords, optional - keyword arguments which passed to matplotlib.table.table. + 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. @@ -82,7 +82,7 @@ def scatter_matrix( density_kwds=None, hist_kwds=None, range_padding=0.05, - **kwds + **kwargs ): """ Draw a matrix of scatter plots. @@ -91,28 +91,26 @@ def scatter_matrix( ---------- frame : DataFrame alpha : float, optional - amount of transparency applied + Amount of transparency applied. figsize : (float,float), optional - a tuple (width, height) in inches + A tuple (width, height) in inches. ax : Matplotlib axis object, optional grid : bool, optional - setting this to True will show the grid + 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 + Pick between 'kde' and 'hist' for either Kernel Density Estimation or + Histogram plot in the diagonal. marker : str, optional - Matplotlib marker type, default '.' - hist_kwds : other plotting keyword arguments - To be passed to hist function - density_kwds : other plotting keyword arguments - To be passed to kernel density estimate plot - range_padding : float, optional - relative extension of axis range in x and y - with respect to (x_max - x_min) or (y_max - y_min), - default 0.05 - kwds : other plotting keyword arguments - To be passed to scatter function + Matplotlib marker type, default '.'. + hist_kwds : keywords + Keyword arguments to be passed to hist function. + density_kwds : keywords + Keyword arguments to be passed to kernel density estimate plot. + 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 ------- @@ -136,7 +134,7 @@ def scatter_matrix( density_kwds=density_kwds, hist_kwds=hist_kwds, range_padding=range_padding, - **kwds + **kwargs ) @@ -215,8 +213,8 @@ def radviz(frame, class_column, ax=None, color=None, colormap=None, **kwds): @deprecate_kwarg(old_arg_name="data", new_arg_name="frame") def andrews_curves( - frame, class_column, ax=None, samples=200, color=None, colormap=None, **kwds -): + frame, class_column, ax=None, samples=200, color=None, colormap=None, + **kwargs): """ Generate a matplotlib plot of Andrews curves, for visualising clusters of multivariate data. @@ -233,17 +231,17 @@ def andrews_curves( Parameters ---------- frame : DataFrame - Data to be plotted, preferably normalized to (0.0, 1.0) + 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 + Colors to use for the different classes. colormap : str or matplotlib colormap object, default None Colormap to select colors from. If string, load colormap with that name from matplotlib. - kwds : keywords - Options to pass to matplotlib plotting method + **kwargs + Options to pass to matplotlib plotting method. Returns ------- @@ -257,7 +255,7 @@ def andrews_curves( samples=samples, color=color, colormap=colormap, - **kwds + **kwargs ) @@ -327,7 +325,7 @@ def parallel_coordinates( axvlines=True, axvlines_kwds=None, sort_labels=False, - **kwds + **kwargs ): """ Parallel coordinates plotting. @@ -336,30 +334,29 @@ def parallel_coordinates( ---------- frame : DataFrame class_column : str - Column name containing class names + Column name containing class names. cols : list, optional - A list of column names to use + A list of column names to use. ax : matplotlib.axis, optional - matplotlib axis object + Matplotlib axis object. color : list or tuple, optional - Colors to use for the different classes + Colors to use for the different classes. use_columns : bool, optional - If true, columns will be used as xticks + If true, columns will be used as xticks. xticks : list or tuple, optional - A list of values to use for xticks + A list of values to use for xticks. colormap : str or matplotlib colormap, default None Colormap to use for line colors. axvlines : bool, optional - If true, vertical lines will be added at each xtick + If true, vertical lines will be added at each xtick. axvlines_kwds : keywords, optional - Options to be passed to axvline method for vertical lines - sort_labels : bool, False - Sort class_column labels, useful when assigning colors + Options to be passed to axvline method for vertical lines. + sort_labels : bool, default False + Sort class_column labels, useful when assigning colors. .. versionadded:: 0.20.0 - - kwds : keywords - Options to pass to matplotlib plotting method + **kwargs + Options to pass to matplotlib plotting method. Returns ------- @@ -388,7 +385,7 @@ def parallel_coordinates( axvlines=axvlines, axvlines_kwds=axvlines_kwds, sort_labels=sort_labels, - **kwds + **kwargs ) @@ -411,7 +408,7 @@ def lag_plot(series, lag=1, ax=None, **kwds): return plot_backend.lag_plot(series=series, lag=lag, ax=ax, **kwds) -def autocorrelation_plot(series, ax=None, **kwds): +def autocorrelation_plot(series, ax=None, **kwargs): """ Autocorrelation plot for time series. @@ -419,15 +416,15 @@ def autocorrelation_plot(series, ax=None, **kwds): ---------- series : Time series ax : Matplotlib axis object, optional - kwds : keywords - Options to pass to matplotlib plotting method + **kwargs + Options to pass to matplotlib plotting method. Returns ------- class:`matplotlib.axis.Axes` """ plot_backend = _get_plot_backend("matplotlib") - return plot_backend.autocorrelation_plot(series=series, ax=ax, **kwds) + return plot_backend.autocorrelation_plot(series=series, ax=ax, **kwargs) def tsplot(series, plotf, ax=None, **kwargs):