-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Rework style sheet reference example to cycle props #24299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework style sheet reference example to cycle props #24299
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me! I'll let someone else merge it, in case this is not the solution they are looking for.
Sure, let me just squash the commits and update the PR description and checklist. |
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.
703e3ae
to
9b4b0b1
Compare
@@ -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)): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with me. The comment above does need to be changed. I was also fine with the status quo and the comment, but it is strange to have different number of markers...
…299-on-v3.6.x Backport PR #24299 on branch v3.6.x (Rework style sheet reference example to cycle props)
…299-on-v3.6.2-doc Backport PR #24299 on branch v3.6.2-doc (Rework style sheet reference example to cycle props)
PR Summary
There is different number of circles in the last figure of each style, when cycling is disabled.
This causes mismatch between docstring and the actual output.
This tries to support the problem reported in #24022.
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst