MNT: Prevent users from erroneously using legend label API on Axis#28584
MNT: Prevent users from erroneously using legend label API on Axis#28584ksunden merged 1 commit intomatplotlib:mainfrom
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.
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.
Can we get Axis.label documented so this will link?
There was a problem hiding this comment.
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)