Skip to content

Commit 34515a8

Browse files
committed
Addressed comments
1 parent 9184e64 commit 34515a8

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

pandas/plotting/_core.py

+2
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,8 @@ class PlotAccessor(PandasObject):
645645
with columns 'a' and 'c', and one with columns 'b' and 'd'.
646646
Remaining columns that aren't specified will be plotted in
647647
additional subplots (one per column).
648+
.. versionadded:: 1.3.0
649+
648650
sharex : bool, default True if ax is None else False
649651
In case ``subplots=True``, share x axis and set some x axis labels
650652
to invisible; defaults to True if ax is None otherwise False if

pandas/plotting/_matplotlib/core.py

+20-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,26 @@ def __init__(
213213

214214
def _validate_subplots_kwarg(
215215
self, subplots: Union[bool, Sequence[Sequence[str]]]
216-
) -> Union[bool, Sequence[Sequence[int]]]:
216+
) -> Union[bool, List[Tuple[int]]]:
217+
"""
218+
Validate the subplots parameter
219+
220+
- check type and content
221+
- check for duplicate columns
222+
- check for invalid column names
223+
- convert column names into indices
224+
- add missing columns in a group of their own
225+
See comments in code below for more details.
226+
227+
Parameters
228+
----------
229+
subplots : subplots parameters as passed to PlotAccessor
230+
231+
Returns
232+
-------
233+
validated subplots : a bool or a list of tuples of column indices. Columns
234+
in the same tuple will be grouped together in the resulting plot.
235+
"""
217236

218237
if isinstance(subplots, bool):
219238
return subplots

0 commit comments

Comments
 (0)