Skip to content

Commit

Permalink
pandas-dev#11042 formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Hancar, Pavel committed Jul 13, 2019
1 parent 269d368 commit a061704
Showing 1 changed file with 159 additions and 9 deletions.
168 changes: 159 additions & 9 deletions pandas/plotting/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,8 @@ def __call__(self, *args, **kwargs):

return plot_backend.plot(data, kind=kind, **kwargs)

def line(self, x=None, y=None, **kwargs):
def line(self, x=None, y=None, figsize=None, subplots=False, sharex=None,
sharey=False, layout=None, **kwargs):
"""
Plot Series or DataFrame as lines.
Expand All @@ -810,6 +811,22 @@ def line(self, x=None, y=None, **kwargs):
The values to be plotted.
Either the location or the label of the columns to be used.
By default, it will use the remaining DataFrame numeric columns.
figsize : a tuple (width, height) in inches
subplots : boolean, default False
Make separate subplots for each column
sharex : boolean, default True if ax is None else False
In case subplots=True, share x axis and set some x axis labels to invisible;
defaults to True if ax is None otherwise False if an ax is passed in;
Be aware, that passing in both an ax and sharex=True will alter all x axis
labels for all axis in a figure!
sharey : boolean, default False
In case subplots=True, share y axis and set some y axis labels to subplots
layout : tuple (optional)
(rows, columns) for the layout of subplots
title : string or list
Title to use for the plot. If a string is passed, print the string at the
top of the figure. If a list is passed and subplots is True, print each item
in the list above the corresponding subplot.
**kwds
Keyword arguments to pass on to :meth:`DataFrame.plot`.
Expand Down Expand Up @@ -862,7 +879,8 @@ def line(self, x=None, y=None, **kwargs):
"""
return self(kind="line", x=x, y=y, **kwargs)

def bar(self, x=None, y=None, **kwargs):
def bar(self, x=None, y=None, figsize=None, subplots=False, sharex=None,
sharey=False, layout=None, **kwargs):
"""
Vertical bar plot.
Expand All @@ -880,6 +898,22 @@ def bar(self, x=None, y=None, **kwargs):
y : label or position, optional
Allows plotting of one column versus another. If not specified,
all numerical columns are used.
figsize : a tuple (width, height) in inches
subplots : boolean, default False
Make separate subplots for each column
sharex : boolean, default True if ax is None else False
In case subplots=True, share x axis and set some x axis labels to invisible;
defaults to True if ax is None otherwise False if an ax is passed in;
Be aware, that passing in both an ax and sharex=True will alter all x axis
labels for all axis in a figure!
sharey : boolean, default False
In case subplots=True, share y axis and set some y axis labels to subplots
layout : tuple (optional)
(rows, columns) for the layout of subplots
title : string or list
Title to use for the plot. If a string is passed, print the string at the
top of the figure. If a list is passed and subplots is True, print each item
in the list above the corresponding subplot.
**kwds
Additional keyword arguments are documented in
:meth:`DataFrame.plot`.
Expand Down Expand Up @@ -947,7 +981,8 @@ def bar(self, x=None, y=None, **kwargs):
"""
return self(kind="bar", x=x, y=y, **kwargs)

def barh(self, x=None, y=None, **kwargs):
def barh(self, x=None, y=None, figsize=None, subplots=False, sharex=None,
sharey=False, layout=None, **kwargs):
"""
Make a horizontal bar plot.
Expand All @@ -963,6 +998,22 @@ def barh(self, x=None, y=None, **kwargs):
Column to be used for categories.
y : label or position, default All numeric columns in dataframe
Columns to be plotted from the DataFrame.
figsize : a tuple (width, height) in inches
subplots : boolean, default False
Make separate subplots for each column
sharex : boolean, default True if ax is None else False
In case subplots=True, share x axis and set some x axis labels to invisible;
defaults to True if ax is None otherwise False if an ax is passed in;
Be aware, that passing in both an ax and sharex=True will alter all x axis
labels for all axis in a figure!
sharey : boolean, default False
In case subplots=True, share y axis and set some y axis labels to subplots
layout : tuple (optional)
(rows, columns) for the layout of subplots
title : string or list
Title to use for the plot. If a string is passed, print the string at the
top of the figure. If a list is passed and subplots is True, print each item
in the list above the corresponding subplot.
**kwds
Keyword arguments to pass on to :meth:`DataFrame.plot`.
Expand Down Expand Up @@ -1027,7 +1078,8 @@ def barh(self, x=None, y=None, **kwargs):
"""
return self(kind="barh", x=x, y=y, **kwargs)

def box(self, by=None, **kwargs):
def box(self, by=None, figsize=None, subplots=False, sharex=None, sharey=False,
layout=None, **kwargs):
r"""
Make a box plot of the DataFrame columns.
Expand All @@ -1049,6 +1101,22 @@ def box(self, by=None, **kwargs):
----------
by : string or sequence
Column in the DataFrame to group by.
figsize : a tuple (width, height) in inches
subplots : boolean, default False
Make separate subplots for each column
sharex : boolean, default True if ax is None else False
In case subplots=True, share x axis and set some x axis labels to invisible;
defaults to True if ax is None otherwise False if an ax is passed in;
Be aware, that passing in both an ax and sharex=True will alter all x axis
labels for all axis in a figure!
sharey : boolean, default False
In case subplots=True, share y axis and set some y axis labels to subplots
layout : tuple (optional)
(rows, columns) for the layout of subplots
title : string or list
Title to use for the plot. If a string is passed, print the string at the
top of the figure. If a list is passed and subplots is True, print each item
in the list above the corresponding subplot.
**kwds : optional
Additional keywords are documented in
:meth:`DataFrame.plot`.
Expand Down Expand Up @@ -1077,7 +1145,8 @@ def box(self, by=None, **kwargs):
"""
return self(kind="box", by=by, **kwargs)

def hist(self, by=None, bins=10, **kwargs):
def hist(self, by=None, bins=10, figsize=None, subplots=False, sharex=None,
sharey=False, layout=None, **kwargs):
"""
Draw one histogram of the DataFrame's columns.
Expand All @@ -1092,6 +1161,22 @@ def hist(self, by=None, bins=10, **kwargs):
Column in the DataFrame to group by.
bins : int, default 10
Number of histogram bins to be used.
figsize : a tuple (width, height) in inches
subplots : boolean, default False
Make separate subplots for each column
sharex : boolean, default True if ax is None else False
In case subplots=True, share x axis and set some x axis labels to invisible;
defaults to True if ax is None otherwise False if an ax is passed in;
Be aware, that passing in both an ax and sharex=True will alter all x axis
labels for all axis in a figure!
sharey : boolean, default False
In case subplots=True, share y axis and set some y axis labels to subplots
layout : tuple (optional)
(rows, columns) for the layout of subplots
title : string or list
Title to use for the plot. If a string is passed, print the string at the
top of the figure. If a list is passed and subplots is True, print each item
in the list above the corresponding subplot.
**kwds
Additional keyword arguments are documented in
:meth:`DataFrame.plot`.
Expand Down Expand Up @@ -1124,7 +1209,8 @@ def hist(self, by=None, bins=10, **kwargs):
"""
return self(kind="hist", by=by, bins=bins, **kwargs)

def kde(self, bw_method=None, ind=None, **kwargs):
def kde(self, bw_method=None, ind=None, figsize=None, subplots=False, sharex=None,
sharey=False, layout=None, **kwargs):
"""
Generate Kernel Density Estimate plot using Gaussian kernels.
Expand All @@ -1148,6 +1234,22 @@ def kde(self, bw_method=None, ind=None, **kwargs):
1000 equally spaced points are used. If `ind` is a NumPy array, the
KDE is evaluated at the points passed. If `ind` is an integer,
`ind` number of equally spaced points are used.
figsize : a tuple (width, height) in inches
subplots : boolean, default False
Make separate subplots for each column
sharex : boolean, default True if ax is None else False
In case subplots=True, share x axis and set some x axis labels to invisible;
defaults to True if ax is None otherwise False if an ax is passed in;
Be aware, that passing in both an ax and sharex=True will alter all x axis
labels for all axis in a figure!
sharey : boolean, default False
In case subplots=True, share y axis and set some y axis labels to subplots
layout : tuple (optional)
(rows, columns) for the layout of subplots
title : string or list
Title to use for the plot. If a string is passed, print the string at the
top of the figure. If a list is passed and subplots is True, print each item
in the list above the corresponding subplot.
**kwds : optional
Additional keyword arguments are documented in
:meth:`pandas.%(this-datatype)s.plot`.
Expand Down Expand Up @@ -1234,7 +1336,8 @@ def kde(self, bw_method=None, ind=None, **kwargs):

density = kde

def area(self, x=None, y=None, **kwargs):
def area(self, x=None, y=None, figsize=None, subplots=False, sharex=None,
sharey=False, layout=None, **kwargs):
"""
Draw a stacked area plot.
Expand All @@ -1250,6 +1353,22 @@ def area(self, x=None, y=None, **kwargs):
stacked : bool, default True
Area plots are stacked by default. Set to False to create a
unstacked plot.
figsize : a tuple (width, height) in inches
subplots : boolean, default False
Make separate subplots for each column
sharex : boolean, default True if ax is None else False
In case subplots=True, share x axis and set some x axis labels to invisible;
defaults to True if ax is None otherwise False if an ax is passed in;
Be aware, that passing in both an ax and sharex=True will alter all x axis
labels for all axis in a figure!
sharey : boolean, default False
In case subplots=True, share y axis and set some y axis labels to subplots
layout : tuple (optional)
(rows, columns) for the layout of subplots
title : string or list
Title to use for the plot. If a string is passed, print the string at the
top of the figure. If a list is passed and subplots is True, print each item
in the list above the corresponding subplot.
**kwds : optional
Additional keyword arguments are documented in
:meth:`DataFrame.plot`.
Expand Down Expand Up @@ -1307,7 +1426,8 @@ def area(self, x=None, y=None, **kwargs):
"""
return self(kind="area", x=x, y=y, **kwargs)

def pie(self, **kwargs):
def pie(self, figsize=None, subplots=False, sharex=None,
sharey=False, layout=None, **kwargs):
"""
Generate a pie plot.
Expand All @@ -1322,6 +1442,22 @@ def pie(self, **kwargs):
y : int or label, optional
Label or position of the column to plot.
If not provided, ``subplots=True`` argument must be passed.
figsize : a tuple (width, height) in inches
subplots : boolean, default False
Make separate subplots for each column
sharex : boolean, default True if ax is None else False
In case subplots=True, share x axis and set some x axis labels to invisible;
defaults to True if ax is None otherwise False if an ax is passed in;
Be aware, that passing in both an ax and sharex=True will alter all x axis
labels for all axis in a figure!
sharey : boolean, default False
In case subplots=True, share y axis and set some y axis labels to subplots
layout : tuple (optional)
(rows, columns) for the layout of subplots
title : string or list
Title to use for the plot. If a string is passed, print the string at the
top of the figure. If a list is passed and subplots is True, print each item
in the list above the corresponding subplot.
**kwds
Keyword arguments to pass on to :meth:`DataFrame.plot`.
Expand Down Expand Up @@ -1362,7 +1498,8 @@ def pie(self, **kwargs):
raise ValueError("pie requires either y column or 'subplots=True'")
return self(kind="pie", **kwargs)

def scatter(self, x, y, s=None, c=None, **kwargs):
def scatter(self, x, y, s=None, c=None, figsize=None, subplots=False, sharex=None,
sharey=False, layout=None, **kwargs):
"""
Create a scatter plot with varying marker point size and color.
Expand Down Expand Up @@ -1403,6 +1540,19 @@ def scatter(self, x, y, s=None, c=None, **kwargs):
- A column name or position whose values will be used to color the
marker points according to a colormap.
figsize : a tuple (width, height) in inches
subplots : boolean, default False
Make separate subplots for each column
sharex : boolean, default True if ax is None else False
In case subplots=True, share x axis and set some x axis labels to invisible;
defaults to True if ax is None otherwise False if an ax is passed in;
Be aware, that passing in both an ax and sharex=True will alter all x axis
labels for all axis in a figure!
sharey : boolean, default False
In case subplots=True, share y axis and set some y axis labels to subplots
layout : tuple (optional)
(rows, columns) for the layout of subplots
title : string or list
**kwds
Keyword arguments to pass on to :meth:`DataFrame.plot`.
Expand Down

0 comments on commit a061704

Please sign in to comment.