File tree 3 files changed +9
-1
lines changed
3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 56
56
Plotting
57
57
^^^^^^^^
58
58
59
+ - Bug in ``DataFrame.plot`` with a single column and a list-like ``color`` (:issue:`3486`)
60
+
59
61
60
62
61
63
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 @@ -153,6 +153,11 @@ def test_mpl2_color_cycle_str(self):
153
153
else :
154
154
pytest .skip ("not supported in matplotlib < 2.0.0" )
155
155
156
+ def test_color_single_series_list (self ):
157
+ # GH 3486
158
+ df = DataFrame ({"A" : [1 , 2 , 3 ]})
159
+ _check_plot_works (df .plot , color = ['red' ])
160
+
156
161
def test_color_empty_string (self ):
157
162
df = DataFrame (randn (10 , 2 ))
158
163
with pytest .raises (ValueError ):
You can’t perform that action at this time.
0 commit comments