Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
deep-jkl committed Oct 29, 2022
commit 9b4b0b1dca3c2cd19520f05daa0f60e4623d6e13
3 changes: 2 additions & 1 deletion examples/style_sheets/style_sheets_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to remove the comment above now?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, on further reading I think the comment above is now more correct (with the range(nb_samples) always being exhausted now rather than sometimes cutting short based on the number of colors.

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)
Expand Down