Skip to content

Commit 45647a4

Browse files
committed
CLN: eliminate use of legacy "axes.color_cycle"
It turns out that even if "axes.prop_cycle" is not defined, then it will be composed of CN colors (hex notation). However, in the current matplotlib there is no "axes.color_cycle" property in rcParams at all (not even allowed to setup).
1 parent 31125f7 commit 45647a4

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pandas/plotting/_matplotlib/style.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,7 @@ def _get_default_colors(num_colors: int) -> List[Color]:
147147
"""Get ``num_colors`` of default colors from matplotlib rc params."""
148148
import matplotlib.pyplot as plt
149149

150-
# need to call list() on the result to copy so we don't
151-
# modify the global rcParams below
152-
try:
153-
colors = [c["color"] for c in list(plt.rcParams["axes.prop_cycle"])]
154-
except KeyError:
155-
colors = list(plt.rcParams.get("axes.color_cycle", list("bgrcmyk")))
156-
150+
colors = [c["color"] for c in plt.rcParams["axes.prop_cycle"]]
157151
return colors[0:num_colors]
158152

159153

0 commit comments

Comments
 (0)