Skip to content

Commit a6d6d89

Browse files
authored
Make color validation more forgiving
The current version throws a false positive if the style string contains `s` or `o`, which are valid marker styles and not colors. For example: ``` style='s', color='C3' ``` should be legal, but currently throws an error. My suggestion is to check for only the letters that are color codes.
1 parent 0efc71b commit a6d6d89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/plotting/_matplotlib/core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def _validate_color_args(self):
238238
styles = [self.style]
239239
# need only a single match
240240
for s in styles:
241-
if re.match("^[a-z]+?", s) is not None:
241+
if re.match("^[bgrcmykw]+?", s) is not None:
242242
raise ValueError(
243243
"Cannot pass 'style' string with a color "
244244
"symbol and 'color' keyword argument. Please"

0 commit comments

Comments
 (0)