File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,8 @@ def __init__(
193
193
self ._validate_color_args ()
194
194
195
195
def _validate_color_args (self ):
196
+ import matplotlib .colors
197
+
196
198
if "color" not in self .kwds and "colors" in self .kwds :
197
199
warnings .warn (
198
200
(
@@ -234,7 +236,7 @@ def _validate_color_args(self):
234
236
styles = [self .style ]
235
237
# need only a single match
236
238
for s in styles :
237
- if re . match ( "^[a-z]+?" , s ) is not None :
239
+ if s in matplotlib . colors . BASE_COLORS :
238
240
raise ValueError (
239
241
"Cannot pass 'style' string with a color "
240
242
"symbol and 'color' keyword argument. Please"
Original file line number Diff line number Diff line change @@ -931,3 +931,7 @@ def test_plot_no_numeric_data(self):
931
931
df = pd .Series (["a" , "b" , "c" ])
932
932
with pytest .raises (TypeError ):
933
933
df .plot ()
934
+
935
+ def test_style_single_ok (self ):
936
+ s = pd .Series ([1 , 2 ])
937
+ s .plot (style = "s" , color = "C3" )
You can’t perform that action at this time.
0 commit comments