File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 5555Plotting
5656^^^^^^^^
5757
58+ - Bug in ``DataFrame.plot`` with a single column and a list-like ``color`` (:issue:`3486`)
59+
5860
5961
6062
Original file line number Diff line number Diff line change @@ -180,7 +180,8 @@ def _validate_color_args(self):
180180 colors = self .kwds .pop ('colors' )
181181 self .kwds ['color' ] = colors
182182
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' ])):
184185 # support series.plot(color='green')
185186 self .kwds ['color' ] = [self .kwds ['color' ]]
186187
Original file line number Diff line number Diff line change @@ -153,6 +153,11 @@ def test_mpl2_color_cycle_str(self):
153153 else :
154154 pytest .skip ("not supported in matplotlib < 2.0.0" )
155155
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+
156161 def test_color_empty_string (self ):
157162 df = DataFrame (randn (10 , 2 ))
158163 with pytest .raises (ValueError ):
You can’t perform that action at this time.
0 commit comments