Skip to content

Commit 08a63fb

Browse files
author
Marco Gorelli
committed
📝 move whatsnew entry, reword docstrings
1 parent 81dea8a commit 08a63fb

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

doc/source/whatsnew/v1.0.0.rst

-1
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,6 @@ Plotting
11101110
- Bug in color validation incorrectly raising for non-color styles (:issue:`29122`).
11111111
- Allow :meth:`DataFrame.plot.scatter` to plot ``objects`` and ``datetime`` type data (:issue:`18755`, :issue:`30391`)
11121112
- Bug in :meth:`DataFrame.hist`, ``xrot=0`` does not work with ``by`` and subplots (:issue:`30288`).
1113-
- :func:`.plot` for line/bar now accepts color by dictonary (:issue:`8193`).
11141113

11151114
Groupby/resample/rolling
11161115
^^^^^^^^^^^^^^^^^^^^^^^^

doc/source/whatsnew/v1.1.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ I/O
162162
Plotting
163163
^^^^^^^^
164164

165-
-
165+
- :func:`.plot` for line/bar now accepts color by dictonary (:issue:`8193`).
166166
-
167167

168168
Groupby/resample/rolling

pandas/plotting/_core.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -866,20 +866,20 @@ def line(self, x=None, y=None, **kwargs):
866866
Either the location or the label of the columns to be used.
867867
By default, it will use the remaining DataFrame numeric columns.
868868
color : str, int, array_like, or dict, optional
869-
The color of each line for each row. Possible values are:
869+
The color for each of the DataFrame's columns. Possible values are:
870870
871871
- A single color string referred to by name, RGB or RGBA code,
872872
for instance 'red' or '#a98d19'.
873873
874874
- A sequence of color strings referred to by name, RGB or RGBA
875-
code, which will be used for each line for each row recursively. For
876-
instance ['green','yellow'] all lines for each row will be filled in green
877-
or yellow, alternatively.
875+
code, which will be used for each column recursively. For
876+
instance ['green','yellow'] each column's line will be coloured in
877+
green or yellow, alternatively.
878878
879-
- A dict of the form {column name : color}, so that each row's lines will be
879+
- A dict of the form {column name : color}, so that each column will be
880880
colored accordingly. For example, if your columns are called `a` and `b`,
881-
then passing {'a': 'green', 'b': 'red'} will color the lines for column
882-
`a` in green and lines for column `b` in red.
881+
then passing {'a': 'green', 'b': 'red'} will color lines for column `a` in
882+
green and lines for column `b` in red.
883883
**kwargs
884884
Keyword arguments to pass on to :meth:`DataFrame.plot`.
885885
@@ -961,17 +961,17 @@ def bar(self, x=None, y=None, **kwargs):
961961
Allows plotting of one column versus another. If not specified,
962962
all numerical columns are used.
963963
color : str, int, array_like, or dict, optional
964-
The color of each bar for each row. Possible values are:
964+
The color for each of the DataFrame's columns. Possible values are:
965965
966966
- A single color string referred to by name, RGB or RGBA code,
967967
for instance 'red' or '#a98d19'.
968968
969969
- A sequence of color strings referred to by name, RGB or RGBA
970-
code, which will be used for each bar for each row recursively. For
971-
instance ['green','yellow'] all bars for each row will be filled in green
972-
or yellow, alternatively.
970+
code, which will be used for each column recursively. For
971+
instance ['green','yellow'] each column's bar will be filled in
972+
green or yellow, alternatively.
973973
974-
- A dict of the form {column name : color}, so that each row's bars will be
974+
- A dict of the form {column name : color}, so that each column will be
975975
colored accordingly. For example, if your columns are called `a` and `b`,
976976
then passing {'a': 'green', 'b': 'red'} will color bars for column `a` in
977977
green and bars for column `b` in red.
@@ -1026,7 +1026,7 @@ def bar(self, x=None, y=None, **kwargs):
10261026
>>> axes = df.plot.bar(rot=0, subplots=True)
10271027
>>> axes[1].legend(loc=2) # doctest: +SKIP
10281028
1029-
If we don't like the default colours, we can specify how we'd
1029+
If you don't like the default colours, you can specify how you'd
10301030
like each column to be colored.
10311031
10321032
.. plot::
@@ -1070,17 +1070,17 @@ def barh(self, x=None, y=None, **kwargs):
10701070
y : label or position, default All numeric columns in dataframe
10711071
Columns to be plotted from the DataFrame.
10721072
color : str, int, array_like, or dict, optional
1073-
The color of each bar for each row. Possible values are:
1073+
The color for each of the DataFrame's columns. Possible values are:
10741074
10751075
- A single color string referred to by name, RGB or RGBA code,
10761076
for instance 'red' or '#a98d19'.
10771077
10781078
- A sequence of color strings referred to by name, RGB or RGBA
1079-
code, which will be used for each bar for each row recursively. For
1080-
instance ['green','yellow'] all bars for each row will be filled in green
1081-
or yellow, alternatively.
1079+
code, which will be used for each column recursively. For
1080+
instance ['green','yellow'] each column's bar will be filled in
1081+
green or yellow, alternatively.
10821082
1083-
- A dict of the form {column name : color}, so that each row's bars will be
1083+
- A dict of the form {column name : color}, so that each column will be
10841084
colored accordingly. For example, if your columns are called `a` and `b`,
10851085
then passing {'a': 'green', 'b': 'red'} will color bars for column `a` in
10861086
green and bars for column `b` in red.

0 commit comments

Comments
 (0)