Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v0.20.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ I/O
Plotting
^^^^^^^^

- Bug in ``DataFrame.plot`` with a single column and a list-like ``color`` (:issue:`3486`)




Expand Down
3 changes: 2 additions & 1 deletion pandas/plotting/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ def _validate_color_args(self):
colors = self.kwds.pop('colors')
self.kwds['color'] = colors

if ('color' in self.kwds and self.nseries == 1):
if ('color' in self.kwds and self.nseries == 1 and
not is_list_like(self.kwds['color'])):
# support series.plot(color='green')
self.kwds['color'] = [self.kwds['color']]

Expand Down
5 changes: 5 additions & 0 deletions pandas/tests/plotting/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ def test_mpl2_color_cycle_str(self):
else:
pytest.skip("not supported in matplotlib < 2.0.0")

def test_color_single_series_list(self):
# GH 3486
df = DataFrame({"A": [1, 2, 3]})
_check_plot_works(df.plot, color=['red'])

def test_color_empty_string(self):
df = DataFrame(randn(10, 2))
with pytest.raises(ValueError):
Expand Down