You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use attributes Axes.x/yaxis instead of Axes.get_x/yaxis()
We're already largely doing this in code base and examples.
This PR changes some remaining usages and discourages the use of the
getters in their docstrings.
*Note on API consistency*: While we generally use getters, I'm not too
worried that people may find this inconsistent. An axis is rather a
sub-part than a property. In particular, it will mostly be used as an
indirection to one of its properties, i.e. `ax.xaxis.get_units()`.
Here we still have a final getter call. IMHO it even looks better / more
pythonic than a method chain: `ax.get_xaxis().get_units()`.
I'm also not too worried that people may try to overwrite the plain
attributes `Axes.x/yaxis`. While one could turn them into properties
to protect overwriting, the attributes have already been used widely
in examples and we did not get any complaints.
0 commit comments