-
Notifications
You must be signed in to change notification settings - Fork 51
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
Peusdo-infinite cycle #30
Comments
Interesting idea, but there are some tricky details to work out. For one thing, the composite operations currently rely on knowing the length of the A simple way to make this work only on the outer-most layer def pcycle(itr):
itr = iter(itr)
last = next(itr)
yield last
try:
while True:
last = next(itr)
yield last
except StopIteration:
while True:
yield last which is something that might already exist in itertools and friends. As of 2 days ago, there is now a released version of cycler with You could also do something like (again, works with 0.10) sty_cy = itertools.chain(colorful_cycle, boring_cycle()) or sty_cy = itertools.chain(colorful_cycle, itertools.repeat(final_sty_dict)) |
Add a generator function to add an infinite 'tail' onto a cycler. Closes matplotlib#30
Add a generator function to add an infinite 'tail' onto a cycler. Closes matplotlib#30
It could be useful to have the possibility to define a pseudo-infinite cycle which gives some first colors and then use the last one defined in the cycle.
Why this could be useful ? When you have several curves, it could be better to just colorize some curves to highlight them whereas the others are less important but you still need to show them in gray for example.
Here is an example : see the rule 8.
The text was updated successfully, but these errors were encountered: