Skip to content

Commit a061704

Browse files
author
Hancar, Pavel
committed
pandas-dev#11042 formatting
1 parent 269d368 commit a061704

File tree

1 file changed

+159
-9
lines changed

1 file changed

+159
-9
lines changed

pandas/plotting/_core.py

+159-9
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,8 @@ def __call__(self, *args, **kwargs):
793793

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

796-
def line(self, x=None, y=None, **kwargs):
796+
def line(self, x=None, y=None, figsize=None, subplots=False, sharex=None,
797+
sharey=False, layout=None, **kwargs):
797798
"""
798799
Plot Series or DataFrame as lines.
799800
@@ -810,6 +811,22 @@ def line(self, x=None, y=None, **kwargs):
810811
The values to be plotted.
811812
Either the location or the label of the columns to be used.
812813
By default, it will use the remaining DataFrame numeric columns.
814+
figsize : a tuple (width, height) in inches
815+
subplots : boolean, default False
816+
Make separate subplots for each column
817+
sharex : boolean, default True if ax is None else False
818+
In case subplots=True, share x axis and set some x axis labels to invisible;
819+
defaults to True if ax is None otherwise False if an ax is passed in;
820+
Be aware, that passing in both an ax and sharex=True will alter all x axis
821+
labels for all axis in a figure!
822+
sharey : boolean, default False
823+
In case subplots=True, share y axis and set some y axis labels to subplots
824+
layout : tuple (optional)
825+
(rows, columns) for the layout of subplots
826+
title : string or list
827+
Title to use for the plot. If a string is passed, print the string at the
828+
top of the figure. If a list is passed and subplots is True, print each item
829+
in the list above the corresponding subplot.
813830
**kwds
814831
Keyword arguments to pass on to :meth:`DataFrame.plot`.
815832
@@ -862,7 +879,8 @@ def line(self, x=None, y=None, **kwargs):
862879
"""
863880
return self(kind="line", x=x, y=y, **kwargs)
864881

865-
def bar(self, x=None, y=None, **kwargs):
882+
def bar(self, x=None, y=None, figsize=None, subplots=False, sharex=None,
883+
sharey=False, layout=None, **kwargs):
866884
"""
867885
Vertical bar plot.
868886
@@ -880,6 +898,22 @@ def bar(self, x=None, y=None, **kwargs):
880898
y : label or position, optional
881899
Allows plotting of one column versus another. If not specified,
882900
all numerical columns are used.
901+
figsize : a tuple (width, height) in inches
902+
subplots : boolean, default False
903+
Make separate subplots for each column
904+
sharex : boolean, default True if ax is None else False
905+
In case subplots=True, share x axis and set some x axis labels to invisible;
906+
defaults to True if ax is None otherwise False if an ax is passed in;
907+
Be aware, that passing in both an ax and sharex=True will alter all x axis
908+
labels for all axis in a figure!
909+
sharey : boolean, default False
910+
In case subplots=True, share y axis and set some y axis labels to subplots
911+
layout : tuple (optional)
912+
(rows, columns) for the layout of subplots
913+
title : string or list
914+
Title to use for the plot. If a string is passed, print the string at the
915+
top of the figure. If a list is passed and subplots is True, print each item
916+
in the list above the corresponding subplot.
883917
**kwds
884918
Additional keyword arguments are documented in
885919
:meth:`DataFrame.plot`.
@@ -947,7 +981,8 @@ def bar(self, x=None, y=None, **kwargs):
947981
"""
948982
return self(kind="bar", x=x, y=y, **kwargs)
949983

950-
def barh(self, x=None, y=None, **kwargs):
984+
def barh(self, x=None, y=None, figsize=None, subplots=False, sharex=None,
985+
sharey=False, layout=None, **kwargs):
951986
"""
952987
Make a horizontal bar plot.
953988
@@ -963,6 +998,22 @@ def barh(self, x=None, y=None, **kwargs):
963998
Column to be used for categories.
964999
y : label or position, default All numeric columns in dataframe
9651000
Columns to be plotted from the DataFrame.
1001+
figsize : a tuple (width, height) in inches
1002+
subplots : boolean, default False
1003+
Make separate subplots for each column
1004+
sharex : boolean, default True if ax is None else False
1005+
In case subplots=True, share x axis and set some x axis labels to invisible;
1006+
defaults to True if ax is None otherwise False if an ax is passed in;
1007+
Be aware, that passing in both an ax and sharex=True will alter all x axis
1008+
labels for all axis in a figure!
1009+
sharey : boolean, default False
1010+
In case subplots=True, share y axis and set some y axis labels to subplots
1011+
layout : tuple (optional)
1012+
(rows, columns) for the layout of subplots
1013+
title : string or list
1014+
Title to use for the plot. If a string is passed, print the string at the
1015+
top of the figure. If a list is passed and subplots is True, print each item
1016+
in the list above the corresponding subplot.
9661017
**kwds
9671018
Keyword arguments to pass on to :meth:`DataFrame.plot`.
9681019
@@ -1027,7 +1078,8 @@ def barh(self, x=None, y=None, **kwargs):
10271078
"""
10281079
return self(kind="barh", x=x, y=y, **kwargs)
10291080

1030-
def box(self, by=None, **kwargs):
1081+
def box(self, by=None, figsize=None, subplots=False, sharex=None, sharey=False,
1082+
layout=None, **kwargs):
10311083
r"""
10321084
Make a box plot of the DataFrame columns.
10331085
@@ -1049,6 +1101,22 @@ def box(self, by=None, **kwargs):
10491101
----------
10501102
by : string or sequence
10511103
Column in the DataFrame to group by.
1104+
figsize : a tuple (width, height) in inches
1105+
subplots : boolean, default False
1106+
Make separate subplots for each column
1107+
sharex : boolean, default True if ax is None else False
1108+
In case subplots=True, share x axis and set some x axis labels to invisible;
1109+
defaults to True if ax is None otherwise False if an ax is passed in;
1110+
Be aware, that passing in both an ax and sharex=True will alter all x axis
1111+
labels for all axis in a figure!
1112+
sharey : boolean, default False
1113+
In case subplots=True, share y axis and set some y axis labels to subplots
1114+
layout : tuple (optional)
1115+
(rows, columns) for the layout of subplots
1116+
title : string or list
1117+
Title to use for the plot. If a string is passed, print the string at the
1118+
top of the figure. If a list is passed and subplots is True, print each item
1119+
in the list above the corresponding subplot.
10521120
**kwds : optional
10531121
Additional keywords are documented in
10541122
:meth:`DataFrame.plot`.
@@ -1077,7 +1145,8 @@ def box(self, by=None, **kwargs):
10771145
"""
10781146
return self(kind="box", by=by, **kwargs)
10791147

1080-
def hist(self, by=None, bins=10, **kwargs):
1148+
def hist(self, by=None, bins=10, figsize=None, subplots=False, sharex=None,
1149+
sharey=False, layout=None, **kwargs):
10811150
"""
10821151
Draw one histogram of the DataFrame's columns.
10831152
@@ -1092,6 +1161,22 @@ def hist(self, by=None, bins=10, **kwargs):
10921161
Column in the DataFrame to group by.
10931162
bins : int, default 10
10941163
Number of histogram bins to be used.
1164+
figsize : a tuple (width, height) in inches
1165+
subplots : boolean, default False
1166+
Make separate subplots for each column
1167+
sharex : boolean, default True if ax is None else False
1168+
In case subplots=True, share x axis and set some x axis labels to invisible;
1169+
defaults to True if ax is None otherwise False if an ax is passed in;
1170+
Be aware, that passing in both an ax and sharex=True will alter all x axis
1171+
labels for all axis in a figure!
1172+
sharey : boolean, default False
1173+
In case subplots=True, share y axis and set some y axis labels to subplots
1174+
layout : tuple (optional)
1175+
(rows, columns) for the layout of subplots
1176+
title : string or list
1177+
Title to use for the plot. If a string is passed, print the string at the
1178+
top of the figure. If a list is passed and subplots is True, print each item
1179+
in the list above the corresponding subplot.
10951180
**kwds
10961181
Additional keyword arguments are documented in
10971182
:meth:`DataFrame.plot`.
@@ -1124,7 +1209,8 @@ def hist(self, by=None, bins=10, **kwargs):
11241209
"""
11251210
return self(kind="hist", by=by, bins=bins, **kwargs)
11261211

1127-
def kde(self, bw_method=None, ind=None, **kwargs):
1212+
def kde(self, bw_method=None, ind=None, figsize=None, subplots=False, sharex=None,
1213+
sharey=False, layout=None, **kwargs):
11281214
"""
11291215
Generate Kernel Density Estimate plot using Gaussian kernels.
11301216
@@ -1148,6 +1234,22 @@ def kde(self, bw_method=None, ind=None, **kwargs):
11481234
1000 equally spaced points are used. If `ind` is a NumPy array, the
11491235
KDE is evaluated at the points passed. If `ind` is an integer,
11501236
`ind` number of equally spaced points are used.
1237+
figsize : a tuple (width, height) in inches
1238+
subplots : boolean, default False
1239+
Make separate subplots for each column
1240+
sharex : boolean, default True if ax is None else False
1241+
In case subplots=True, share x axis and set some x axis labels to invisible;
1242+
defaults to True if ax is None otherwise False if an ax is passed in;
1243+
Be aware, that passing in both an ax and sharex=True will alter all x axis
1244+
labels for all axis in a figure!
1245+
sharey : boolean, default False
1246+
In case subplots=True, share y axis and set some y axis labels to subplots
1247+
layout : tuple (optional)
1248+
(rows, columns) for the layout of subplots
1249+
title : string or list
1250+
Title to use for the plot. If a string is passed, print the string at the
1251+
top of the figure. If a list is passed and subplots is True, print each item
1252+
in the list above the corresponding subplot.
11511253
**kwds : optional
11521254
Additional keyword arguments are documented in
11531255
:meth:`pandas.%(this-datatype)s.plot`.
@@ -1234,7 +1336,8 @@ def kde(self, bw_method=None, ind=None, **kwargs):
12341336

12351337
density = kde
12361338

1237-
def area(self, x=None, y=None, **kwargs):
1339+
def area(self, x=None, y=None, figsize=None, subplots=False, sharex=None,
1340+
sharey=False, layout=None, **kwargs):
12381341
"""
12391342
Draw a stacked area plot.
12401343
@@ -1250,6 +1353,22 @@ def area(self, x=None, y=None, **kwargs):
12501353
stacked : bool, default True
12511354
Area plots are stacked by default. Set to False to create a
12521355
unstacked plot.
1356+
figsize : a tuple (width, height) in inches
1357+
subplots : boolean, default False
1358+
Make separate subplots for each column
1359+
sharex : boolean, default True if ax is None else False
1360+
In case subplots=True, share x axis and set some x axis labels to invisible;
1361+
defaults to True if ax is None otherwise False if an ax is passed in;
1362+
Be aware, that passing in both an ax and sharex=True will alter all x axis
1363+
labels for all axis in a figure!
1364+
sharey : boolean, default False
1365+
In case subplots=True, share y axis and set some y axis labels to subplots
1366+
layout : tuple (optional)
1367+
(rows, columns) for the layout of subplots
1368+
title : string or list
1369+
Title to use for the plot. If a string is passed, print the string at the
1370+
top of the figure. If a list is passed and subplots is True, print each item
1371+
in the list above the corresponding subplot.
12531372
**kwds : optional
12541373
Additional keyword arguments are documented in
12551374
:meth:`DataFrame.plot`.
@@ -1307,7 +1426,8 @@ def area(self, x=None, y=None, **kwargs):
13071426
"""
13081427
return self(kind="area", x=x, y=y, **kwargs)
13091428

1310-
def pie(self, **kwargs):
1429+
def pie(self, figsize=None, subplots=False, sharex=None,
1430+
sharey=False, layout=None, **kwargs):
13111431
"""
13121432
Generate a pie plot.
13131433
@@ -1322,6 +1442,22 @@ def pie(self, **kwargs):
13221442
y : int or label, optional
13231443
Label or position of the column to plot.
13241444
If not provided, ``subplots=True`` argument must be passed.
1445+
figsize : a tuple (width, height) in inches
1446+
subplots : boolean, default False
1447+
Make separate subplots for each column
1448+
sharex : boolean, default True if ax is None else False
1449+
In case subplots=True, share x axis and set some x axis labels to invisible;
1450+
defaults to True if ax is None otherwise False if an ax is passed in;
1451+
Be aware, that passing in both an ax and sharex=True will alter all x axis
1452+
labels for all axis in a figure!
1453+
sharey : boolean, default False
1454+
In case subplots=True, share y axis and set some y axis labels to subplots
1455+
layout : tuple (optional)
1456+
(rows, columns) for the layout of subplots
1457+
title : string or list
1458+
Title to use for the plot. If a string is passed, print the string at the
1459+
top of the figure. If a list is passed and subplots is True, print each item
1460+
in the list above the corresponding subplot.
13251461
**kwds
13261462
Keyword arguments to pass on to :meth:`DataFrame.plot`.
13271463
@@ -1362,7 +1498,8 @@ def pie(self, **kwargs):
13621498
raise ValueError("pie requires either y column or 'subplots=True'")
13631499
return self(kind="pie", **kwargs)
13641500

1365-
def scatter(self, x, y, s=None, c=None, **kwargs):
1501+
def scatter(self, x, y, s=None, c=None, figsize=None, subplots=False, sharex=None,
1502+
sharey=False, layout=None, **kwargs):
13661503
"""
13671504
Create a scatter plot with varying marker point size and color.
13681505
@@ -1403,6 +1540,19 @@ def scatter(self, x, y, s=None, c=None, **kwargs):
14031540
14041541
- A column name or position whose values will be used to color the
14051542
marker points according to a colormap.
1543+
figsize : a tuple (width, height) in inches
1544+
subplots : boolean, default False
1545+
Make separate subplots for each column
1546+
sharex : boolean, default True if ax is None else False
1547+
In case subplots=True, share x axis and set some x axis labels to invisible;
1548+
defaults to True if ax is None otherwise False if an ax is passed in;
1549+
Be aware, that passing in both an ax and sharex=True will alter all x axis
1550+
labels for all axis in a figure!
1551+
sharey : boolean, default False
1552+
In case subplots=True, share y axis and set some y axis labels to subplots
1553+
layout : tuple (optional)
1554+
(rows, columns) for the layout of subplots
1555+
title : string or list
14061556
14071557
**kwds
14081558
Keyword arguments to pass on to :meth:`DataFrame.plot`.

0 commit comments

Comments
 (0)