File tree 3 files changed +8
-2
lines changed
3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 54
54
Plotting
55
55
^^^^^^^^
56
56
57
-
57
+ - Bug in ``DataFrame.plot`` with a single column and a list-like ``color`` (:issue:`3486`)
58
58
59
59
60
60
Groupby/Resample/Rolling
Original file line number Diff line number Diff line change @@ -180,7 +180,8 @@ def _validate_color_args(self):
180
180
colors = self .kwds .pop ('colors' )
181
181
self .kwds ['color' ] = colors
182
182
183
- if ('color' in self .kwds and self .nseries == 1 ):
183
+ if ('color' in self .kwds and self .nseries == 1 and
184
+ not is_list_like (self .kwds ['color' ])):
184
185
# support series.plot(color='green')
185
186
self .kwds ['color' ] = [self .kwds ['color' ]]
186
187
Original file line number Diff line number Diff line change @@ -152,6 +152,11 @@ def test_mpl2_color_cycle_str(self):
152
152
else :
153
153
pytest .skip ("not supported in matplotlib < 2.0.0" )
154
154
155
+ def test_color_single_series_list (self ):
156
+ # GH 3486
157
+ df = DataFrame ({"A" : [1 , 2 , 3 ]})
158
+ _check_plot_works (df .plot , color = ['red' ])
159
+
155
160
def test_color_empty_string (self ):
156
161
df = DataFrame (randn (10 , 2 ))
157
162
with pytest .raises (ValueError ):
You can’t perform that action at this time.
0 commit comments