Skip to content

Commit 9b4b0b1

Browse files
committed
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.
1 parent 54360f3 commit 9b4b0b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/style_sheets/style_sheets_reference.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ def plot_colored_circles(ax, prng, nb_samples=15):
6363
the color cycle, because different styles may have different numbers
6464
of colors.
6565
"""
66-
for sty_dict, j in zip(plt.rcParams['axes.prop_cycle'], range(nb_samples)):
66+
for sty_dict, j in zip(plt.rcParams['axes.prop_cycle'](),
67+
range(nb_samples)):
6768
ax.add_patch(plt.Circle(prng.normal(scale=3, size=2),
6869
radius=1.0, color=sty_dict['color']))
6970
ax.grid(visible=True)

0 commit comments

Comments
 (0)