Skip to content
Merged
Prev Previous commit
Next Next commit
single "next color" for default face/line
  • Loading branch information
landoskape committed Jan 28, 2025
commit 35f5c626641c52e5ef179f1d0166407dbc352d62
6 changes: 4 additions & 2 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8753,6 +8753,10 @@ def cycle_color(color, alpha=None):
return color_list

# Convert colors to chain (number of colors can be different from len(vpstats))
if facecolor is None or linecolor is None:
if not mpl.rcParams['_internal.classic_mode']:
next_color = self._get_lines.get_next_color()

if facecolor is not None:
facecolor = cycle_color(facecolor)
else:
Expand All @@ -8761,7 +8765,6 @@ def cycle_color(color, alpha=None):
if mpl.rcParams['_internal.classic_mode']:
facecolor = cycle_color('y', alpha=default_facealpha)
else:
next_color = self._get_lines.get_next_color()
facecolor = cycle_color(next_color, alpha=default_facealpha)

if linecolor is not None:
Expand All @@ -8770,7 +8773,6 @@ def cycle_color(color, alpha=None):
if mpl.rcParams['_internal.classic_mode']:
linecolor = cycle_color('r')
else:
next_color = self._get_lines.get_next_color()
linecolor = cycle_color(next_color)

# Check whether we are rendering vertically or horizontally
Expand Down