Skip to content

Commit 127651b

Browse files
committed
BUG: except raised if plot parameters has both color and style with color #2588
1 parent 13f1f74 commit 127651b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

pandas/tools/plotting.py

+1
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,7 @@ def _get_colors(self):
10501050
return colors
10511051

10521052
def _maybe_add_color(self, colors, kwds, style, i):
1053+
kwds.pop('color', None)
10531054
if style is None or re.match('[a-z]+', style) is None:
10541055
kwds['color'] = colors[i % len(colors)]
10551056

pandas/tseries/tests/test_plotting.py

+12
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@ def test_tsplot(self):
9797
ax = ts.plot(style='k')
9898
self.assert_((0., 0., 0.) == ax.get_lines()[0].get_color())
9999

100+
@slow
101+
def test_both_style_and_color(self):
102+
import matplotlib.pyplot as plt
103+
plt.close('all')
104+
105+
ts = tm.makeTimeSeries()
106+
ts.plot(style='b-', color='#000099') #works
107+
108+
plt.close('all')
109+
s = ts.reset_index(drop=True)
110+
s.plot(style='b-', color='#000099') #non-tsplot
111+
100112
@slow
101113
def test_high_freq(self):
102114
freaks = ['ms', 'us']

0 commit comments

Comments
 (0)