| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
The use of attributes .ax vs .axes is a mess. Instead of fixing single issues like here or in ContourSets in #12443, we need to
Step 1: Current stateUsages of self.ax (searched for self.ax = ):
Usages of self.axes (searched for self.axes = ):
Step 2: Preferred solutionPro self.ax:
Pro 'self.axes`:
IMHO, there's no clear winner. I slightly lean towards keeping self.ax. But this is really up for discussion. |
Sorry, something went wrong.
Just to be clear, it's a lot more classes, in practice (not just 13 vs 7 like the count above suggests): all Artists have .axes, so that's also Line2D, all the Collections, all the Patches, etc... which are also much more commonly used than any of the classes that use .ax. And as a consequence, other classes (e.g. Colorbar, as noted in #15986 (comment), but also Animation) also typically assume that they can access parent axes of other objects (which are typically artists, but not always) with .axes. |
Sorry, something went wrong.
|
As the most likely guilty party in establishing the ax attributes, I'm OK with switching to axes. It will be interesting to see how much external code this ends up affecting. |
Sorry, something went wrong.
There was a problem hiding this comment.
I'm also fine with switching to axes.
@tacaswell since this change may possibly affect a number of users, IMHO you should also give your consent.
Sorry, something went wrong.
For consistency with other artists. In particular, Colorbar.remove assumes that the `.axes` attribute exists. Also a smattering of cleanups.
|
rebased |
Sorry, something went wrong.
|
As we don't have a good sense of how big of an impact this actually has I am in favor of merging this and seeing what push back we get in the rc / 3.3.0. We should definitly have the .axes alias to make the API more uniform and it would be better to have only one way to do this, but if we get too many complaints we should be ready to leave .ax permanently. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
For consistency with other artists. In particular, Colorbar.remove
assumes that the .axes attribute exists.
Also a smattering of cleanups.
Edit: also do the same for ContourSet, per #12443 (comment).
PR Summary
PR Checklist