Repository: pandas-dev/pandas
Pull request: DOC/PLT: Add `stacked` in doc and doc example for barh and bar plot
- [x] closes #32759
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry


Problem statement:
keyword stacked for bar plots not documented anywhere.
#### Code Sample, a copy-pastable example if possible

```python
df.plot.bar(stacked=True)
df.plot(kind='bar', stacked=True)
```
#### Problem description

There is a keyword argument to create a stacked bar graph. This kwarg is not documented anywhere in the Pandas documentation.

#### Expected Output

The documentations for the methods `df.plot.bar` and `df.plot` should include a description of the kwd `stacked`

#### Version

Pandas 1.0.1

Hints from issue discussion:
take

Commit message: fix linting

Patch to review:
diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py
index e466a215091ea..0fef234f41892 100644
--- a/pandas/plotting/_core.py
+++ b/pandas/plotting/_core.py
@@ -954,6 +954,9 @@ def line(self, x=None, y=None, **kwargs):
 
     @Appender(
         """
+        stacked: bool, default is False
+            If stacked is set to True, stacked bar charts will be plotted.
+
         See Also
         --------
         DataFrame.plot.barh : Horizontal bar plot.
@@ -985,6 +988,13 @@ def line(self, x=None, y=None, **kwargs):
             ...                    'lifespan': lifespan}, index=index)
             >>> ax = df.plot.bar(rot=0)
 
+        Plot stacked bar chars for the DataFrame
+
+        .. plot::
+            :context: close-figs
+
+            >>> ax = df.plot.bar(stacked=True)
+
         Instead of nesting, the figure can be split by column with
         ``subplots=True``. In this case, a :class:`numpy.ndarray` of
         :class:`matplotlib.axes.Axes` are returned.
@@ -1037,6 +1047,9 @@ def bar(self, x=None, y=None, **kwargs):
 
     @Appender(
         """
+        stacked: bool, default is False
+            If stacked is set to True, stacked horizontal bar charts will be plotted.
+
         See Also
         --------
         DataFrame.plot.bar: Vertical bar plot.
@@ -1066,6 +1079,13 @@ def bar(self, x=None, y=None, **kwargs):
             ...                    'lifespan': lifespan}, index=index)
             >>> ax = df.plot.barh()
 
+        Plot stacked bar chars for the DataFrame
+
+        .. plot::
+            :context: close-figs
+
+            >>> ax = df.plot.bar(stacked=True)
+
         We can specify colors for each column
 
         .. plot::


Code review comments:
diff_hunk: @@ -1037,6 +1047,9 @@ def bar(self, x=None, y=None, **kwargs):
 
     @Appender(
         """
+        stacked: bool, default is False
path: pandas/plotting/_core.py
text: @user1:
```suggestion
        stacked : bool, default False
```

@author:
thanks!

diff_hunk: @@ -954,6 +954,9 @@ def line(self, x=None, y=None, **kwargs):
 
     @Appender(
         """
+        stacked: bool, default is False
path: pandas/plotting/_core.py
text: @user1:
```suggestion
        stacked : bool, default False
```

@author:
thanks!