-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MNT: Prevent users from erroneously using legend label API on Axis #28584
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
f848210
to
2a4710a
Compare
Need to fix internal usage of |
2a4710a
to
8000fcc
Compare
lib/matplotlib/axis.py
Outdated
.. admonition:: Discouraged | ||
|
||
This overrides `.Artist.get_label`, which is for legend labels, with a new | ||
semantic. It is recommended to use the attribute `.Axis.label` instead. |
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've been defensive here and only discouraged but not deprecated this. It's been working for users and I'm not clear whether a deprecation is worth it. We can always add a deprecation later.
8000fcc
to
8220f15
Compare
.. admonition:: Discouraged | ||
This overrides `.Artist.get_label`, which is for legend labels, with a new | ||
semantic. It is recommended to use the attribute ``Axis.label`` instead. |
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.
Can we get Axis.label
documented so this will link?
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.
The way attributes are currently documented - Attributes section in the class docstring (https://matplotlib.org/stable/api/axis_api.html#matplotlib.axis.Axis) - they cannot be referenced. I believe we must swich to something like #28825. But before going full scale, we should test it on Axes
in #28825. This is far beyond this PR. I would like to get this PR into 3.10, but don't want to push the documentation restructuring for it. For now, I suggest that literal is good enough and we can do attribute linking when there is time.
Closes matplotlib#27971. For a complete explanation see matplotlib#27971 (comment)
8220f15
to
bba0678
Compare
It looks like we missed that this broke docs?
|
Follow-up to matplotlib#28584.
…atplotlib#28584) Closes matplotlib#27971. For a complete explanation see matplotlib#27971 (comment)
Follow-up to matplotlib#28584.
Closes #27971.
For a complete explanation see #27971 (comment)