8000 BUG: fix matplotlib warning on CN color by ivanovmg · Pull Request #36981 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: fix matplotlib warning on CN color #36981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Oct 10, 2020
Prev Previous commit
Next Next commit
REF: remove function _is_cn_color
conv.to_rgba handles CN colors itself.
  • Loading branch information
ivanovmg committed Oct 9, 2020
commit 25c0df0d377f32f804c9f0eb5cc66ca8891de7bb
8 changes: 0 additions & 8 deletions pandas/plotting/_matplotlib/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ def random_color(column):
return colors


def _is_cn_color(color: str) -> bool:
"""Check if color string is CN color, like 'C0', 'C1', etc."""
cn_colors = ["C" + str(x) for x in range(10)]
return bool(color in cn_colors)


def _is_single_color(color: str) -> bool:
"""Check if ``color`` is a single color.

Expand All @@ -104,8 +98,6 @@ def _is_single_color(color: str) -> bool:
False otherwise.
"""
conv = matplotlib.colors.ColorConverter()
if _is_cn_color(color):
return True
try:
conv.to_rgba(color)
except ValueError:
Expand Down
0