Skip to content

Honor set_rlabel_position on partial-wedge polar axes - #32539

Open
mertkayacs wants to merge 1 commit into
matplotlib:mainfrom
mertkayacs:fix-rlabel-position-wedge-15835
Open

mertkayacs wants to merge 1 commit into
matplotlib:mainfrom
mertkayacs:fix-rlabel-position-wedge-15835

Conversation

@mertkayacs

Copy link
Copy Markdown

PR summary

Closes #15835.

PolarAxes.draw replaces the r-axis label transform with _yaxis_transform whenever the axes shows a partial wedge, and that transform drops _r_label_position entirely, so set_rlabel_position silently does nothing on wedge plots.

This adds _r_label_position_manual, set by set_rlabel_position and cleared on clear(). When the position was set manually, the labels now use the same rlabel-aware transform as on a full circle, RadialTick.update_position derives rotation and anchors from the rlabel angle, and the tick pad shifts along the rlabel ray (the existing _ThetaShift mode 'rlabel'). A manual position is honored even if it lies outside the wedge, as suggested in the issue. The default behavior is unchanged: without a manual position the labels still hug the wedge edges, so no existing plot changes. set_rgrids no longer re-calls set_rlabel_position when no angle is passed, which would otherwise mark the position as manual without moving anything.

AI Disclosure

I used AI agents to help trace the transform chain and to draft the fix and the test. I reviewed, understood and ran all of it myself before opening this PR.

PR quality check

  • Use an expressive title
  • New and changed code is tested
  • Plotting related features are demonstrated in an example (N/A: bug fix, no new feature)
  • New features and API changes have release notes (N/A: no API change)
  • Documentation complies with guidelines

@github-actions

Copy link
Copy Markdown

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process.

You can also join us on discourse chat for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide.
Please let us know if (and how) you use AI, it will help us give you better feedback on your PR.

We strive to be a welcoming and open project. Please follow our Code of Conduct.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"set_rlabel_position" don't work when "set_thetamin"

1 participant