Skip to content

Commit 492af3d

Browse files
committed
Rework stylesheet reference example to cycle props
There is different number of circles in the last figure of each style, when cycling is disabled. This causes mismatch between docstring and actual output.
1 parent 54360f3 commit 492af3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/style_sheets/style_sheets_reference.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
line plot and histogram,
99
1010
"""
11+
from itertools import cycle
1112

1213
import numpy as np
1314
import matplotlib.pyplot as plt
@@ -63,7 +64,8 @@ def plot_colored_circles(ax, prng, nb_samples=15):
6364
the color cycle, because different styles may have different numbers
6465
of colors.
6566
"""
66-
for sty_dict, j in zip(plt.rcParams['axes.prop_cycle'], range(nb_samples)):
67+
for sty_dict, j in zip(cycle(plt.rcParams['axes.prop_cycle']),
68+
range(nb_samples)):
6769
ax.add_patch(plt.Circle(prng.normal(scale=3, size=2),
6870
radius=1.0, color=sty_dict['color']))
6971
ax.grid(visible=True)

0 commit comments

Comments
 (0)