Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ksunden merged 1 commit intomatplotlib:mainfromtimhoffm:axis-get-label
Sep 30, 2024

Conversation

timhoffm
Copy link
Member

Closes#27971.

For a complete explanation see#27971 (comment)

@timhoffmtimhoffmforce-pushed theaxis-get-label branch 3 times, most recently fromf848210 to2a4710aCompareJuly 17, 2024 12:39
@timhoffmtimhoffm marked this pull request as draftJuly 17, 2024 13:19
@timhoffm
Copy link
MemberAuthor

Need to fix internal usage ofAxis.get_label.

Comment on lines 1434 to 1437
.. 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.
Copy link
MemberAuthor

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.

@timhoffmtimhoffm marked this pull request as ready for reviewSeptember 20, 2024 10:26
.. 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can we getAxis.label documented so this will link?

Copy link
MemberAuthor

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 onAxes 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.

@timhoffmtimhoffm added this to thev3.10.0 milestoneSep 24, 2024
@ksundenksunden merged commit537ea7a intomatplotlib:mainSep 30, 2024
41 of 43 checks passed
@QuLogic
Copy link
Member

It looks like we missed that this broke docs?

/home/circleci/project/lib/mpl_toolkits/mplot3d/axis3d.py:docstring of matplotlib.artist.Axis.set:24: WARNING: py:meth reference target not found: matplotlib.axis.Axis.set_label [ref.meth]/home/circleci/project/lib/matplotlib/projections/polar.py:docstring of matplotlib.artist.RadialAxis.set:24: WARNING: py:meth reference target not found: matplotlib.axis.Axis.set_label [ref.meth]/home/circleci/project/lib/matplotlib/projections/polar.py:docstring of matplotlib.artist.ThetaAxis.set:24: WARNING: py:meth reference target not found: matplotlib.axis.Axis.set_label [ref.meth]

timhoffm added a commit to timhoffm/matplotlib that referenced this pull requestOct 1, 2024
@timhoffmtimhoffm deleted the axis-get-label branchOctober 1, 2024 07:04
kyracho pushed a commit to kyracho/matplotlib that referenced this pull requestOct 10, 2024
kyracho pushed a commit to kyracho/matplotlib that referenced this pull requestOct 10, 2024
@mfitzmfitz mentioned this pull requestDec 18, 2024
3 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@ksundenksundenksunden approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.10.0
Development

Successfully merging this pull request may close these issues.

[Bug]: ax.xaxis.set_label(...) doesn't set the x-axis label
3 participants
@timhoffm@QuLogic@ksunden

[8]ページ先頭

©2009-2025 Movatter.jp