-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Cleanup examples #20631
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
Cleanup examples #20631
Conversation
42282fc
to
269ed42
Compare
2addc5b
to
b677c24
Compare
Is this something we want to do this pervasively? I never use |
You are right, we did not have a formal decision on this. Maybe we should. At least we have that API and we should consider if it's something that should be promoted.
It now does after #20569. |
b677c24
to
9921507
Compare
I feel like for the docs it's less confusing if properties are set in a consistent way across examples where the property setting isn't the point, and shoving the property setting into a function helps make it kinda of go away. |
I think that the docs should reflect users' typical use cases, and every axis should have a label. So sure, for highly technical docs where we are doing something completely orthogonal, doing the more mysterious thing is OK. I'm not horrified by
I think the only thing it has going for it is that it is (usually) shorter and can be written in one line. So I'm pretty skeptical of removing it very often or deciding that it is the "preferred" way, if nothing else because of 1. maybe folks can talk about it at the meeting this week (I'll be away, but I'm sure you understand the concerns). |
9921507
to
2aff7ca
Compare
We had some discussion about this in the dev call (which was only a small group today). The overall consensus is that both the explicit setter functions as well as the batch-set have their merits and are targeted at different use cases / user groups. Ideally, they would be separate API-levels, but that's not the case for historic reasons. It is important to communicate the reasons for both concepts and when to use what. I'll write a tutorial on that, which hopefully gives an understanding and clear directions. Until that's agreed on, I put this PR on hold. |
Let's close this. If we want to pick this up at some point, starting anew will be easier than trying to rebase. |
UseMoved to Use set_xticks(ticks, labels) instead of a separate set_xticklabels() #20636 for easier review.set_xticks(positions, labels)
instead ofset_xticks(positions); set_xticklabels(labels)
.ax.set()
instead of multipleset_*
calls when appropritate.