From 9b4b0b1dca3c2cd19520f05daa0f60e4623d6e13 Mon Sep 17 00:00:00 2001 From: Jakub Klus Date: Sat, 29 Oct 2022 10:47:18 +0200 Subject: [PATCH] Rework stylesheet reference example to cycle props There is a different number of circles in the last figure of each style, when cycling is disabled. This causes mismatch between docstring and actual output. Use inifinite props cycler. --- examples/style_sheets/style_sheets_reference.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/style_sheets/style_sheets_reference.py b/examples/style_sheets/style_sheets_reference.py index c2879e7cd905..93cfed82384e 100644 --- a/examples/style_sheets/style_sheets_reference.py +++ b/examples/style_sheets/style_sheets_reference.py @@ -63,7 +63,8 @@ def plot_colored_circles(ax, prng, nb_samples=15): the color cycle, because different styles may have different numbers of colors. """ - for sty_dict, j in zip(plt.rcParams['axes.prop_cycle'], range(nb_samples)): + for sty_dict, j in zip(plt.rcParams['axes.prop_cycle'](), + range(nb_samples)): ax.add_patch(plt.Circle(prng.normal(scale=3, size=2), radius=1.0, color=sty_dict['color'])) ax.grid(visible=True)