-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Update docs on Axes.set_prop_cycle #10662
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
Conversation
Restarted the one failed travis build. The failure seems transient. |
link to the matplotlib cycler. The only difference between it and the
external one is that it has input validation, which was needed for use in
rc params (want to catch invalid values as early as possible).
As for the two ways to do cyclers, that has some history. Initially (in the
external cycler) package, you were supposed to have a cycler for each
element, so the two argument form was the only form you could use. You then
would use the binary operators to construct the final cycler. However, as I
developed the property cycler feature, I found that that restriction wasn't
very friendly for users who just want a simple zip-like cycle. So, a bunch
of us worked on expanding the API a bit to allow a few different
constructions. They are all valid and I wouldn't want to go down any
deprecation routes for this.
…On Fri, Mar 16, 2018 at 9:25 AM, Paul Hobson ***@***.***> wrote:
Restarted the one failed travis build. The failure seems transient.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#10662 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-LBJ-_r477qlgPhCtFe6QO7VJk57ks5te71FgaJpZM4SbA2f>
.
|
c5b290d
to
962a2d7
Compare
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 set_prop_cycle(label, values)
is quite ugly (very matlabby) but won't (... now :)) fight the fight of getting it deprecated...
Backport PR #10662 on branch v2.2.x
@anntzer I share your view on At best, it could be deprecated at cycler.Cycler, but a smaller step in rcsetup.cycler or maybe only in |
You can always try to open a PR for that :-) |
The two arg form comes from the cycler package. I would suggest starting
there. Most users don't know there are actually two cyclers, one in the
package, and one internal to matplotlib. So, they work off of the
documentation for the package. So, if you want to get rid of the two-arg
form, you need to get rid of it there first.
The tricky part for deprecation is that, IIRC, the matplotlib cycler
construction is largely pass-through. So, it you deprecate it there first,
you would need to write a bit of shim code to convert the two-arg form into
the keyword form under-the-hood. Seriously, is it really worth the effort
to go through this for something that isn't broken? Don't forget that
you'll have to update all of the unit tests, too.
I am totally fine with not having examples with the two-arg form, but I
really just don't see the point in getting rid of it. I think we got bigger
fish to fry, here.
…On Wed, Mar 21, 2018 at 7:34 PM, Antony Lee ***@***.***> wrote:
You can always try to open a PR for that :-)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#10662 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-NqHlEBg3NwEw_YjM384dgKGGXCWks5tguNxgaJpZM4SbA2f>
.
|
PR Summary
Documentation update.
Questions
:func:`cycler`
does not link. I'm unclear where it should go. There ismatplotlib.rcsetup.cycler
and the externalcycler.cycler
. Which one is recommended?set_prop_cycle(label, values)
in favor of the equivalentset_prop_cycle(label=values)
. There's no need for additionally supporting the first version and it's not quite pythonic after all.