Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

deep-jkl
Copy link
Contributor

@deep-jkl deep-jkl commented Oct 29, 2022

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

  • [N/A] Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • [N/A] New plotting related features are documented with examples.

Release Notes

  • [N/A] New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • [N/A] API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • [N/A] Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

Copy link
Member

@oscargus oscargus left a 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.

@deep-jkl
Copy link
Contributor Author

deep-jkl commented Oct 29, 2022

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.
@deep-jkl deep-jkl force-pushed the cycle_styles_colored_circles branch from 703e3ae to 9b4b0b1 Compare October 29, 2022 11:54
@QuLogic QuLogic requested a review from jklymak November 1, 2022 08:43
@oscargus oscargus added this to the v3.6-doc milestone Nov 8, 2022
@@ -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
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
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.

Copy link
Member

@jklymak jklymak left a 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...

@tacaswell tacaswell merged commit caec6ad into matplotlib:main Nov 29, 2022
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Nov 29, 2022
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Nov 29, 2022
ksunden added a commit that referenced this pull request Nov 29, 2022
…299-on-v3.6.x

Backport PR #24299 on branch v3.6.x (Rework style sheet reference example to cycle props)
ksunden added a commit that referenced this pull request Nov 29, 2022
…299-on-v3.6.2-doc

Backport PR #24299 on branch v3.6.2-doc (Rework style sheet reference example to cycle props)
@ksunden ksunden mentioned this pull request Feb 20, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants