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

FIX: Ensure Locators on RadialAxis are always correctly wrapped#30174

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
timhoffm merged 1 commit intomatplotlib:mainfromtimhoffm:fix-radialaxis
Jul 12, 2025

Conversation

timhoffm
Copy link
Member

All the wrapping logic is now done whenever a new locator is set in RadialAxis.

Closes#30164 and rearchitects#29798.

@timhoffm
Copy link
MemberAuthor

test_polar_alignment fails. The tick 0.0 is now missing but I don't understand how the change is affecting it.

image

@dstansby
Copy link
Member

dstansby commentedJun 18, 2025
edited
Loading

If you stick aprint(fig.axes[0].yaxis.get_major_locator()) at the end of that test, before this PR it gives aFixedLocator, but after it gives aRadialLocator. Makes sense, but I guess that might be the root cause of the failing image test.

@dstansby
Copy link
Member

diff --git a/lib/matplotlib/projections/polar.py b/lib/matplotlib/projections/polar.pyindex f20498b271..40f431aefb 100644--- a/lib/matplotlib/projections/polar.py+++ b/lib/matplotlib/projections/polar.py@@ -444,7 +444,7 @@ class RadialLocator(mticker.Locator):             if _is_full_circle_rad(*self._axes.viewLim.intervalx):                 rorigin = self._axes.get_rorigin() * self._axes.get_rsign()                 if self._axes.get_rmin() <= rorigin:-                    return [tick for tick in self.base() if tick > rorigin]+                    return [tick for tick in self.base() if tick >= rorigin]         return self.base()      def _zero_in_bounds(self):

☝️ fixes the test that's broken - seems like a sensible change to make, but I'm not sure if it breaks any other tests.

@timhoffm
Copy link
MemberAuthor

timhoffm commentedJun 19, 2025
edited
Loading

Thanks for figuring out. Actually, there is no tick at the center in all thepolar examples.

From a quick look, I don’t fully understand the code you pointed to, but given this is under theis_full_circle_rad condition, it might be intentional to leave out the tick at the center. Will need to have a closer look at context conditions and history of that code.

cross check:MATLAB does not do this. So it’s at least not something built in to match their behavior.

Copy link
Member

@QuLogicQuLogic left a comment

Choose a reason for hiding this comment

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

LGTM, other than fixing the test.

All the wrapping logic is now contained in RadialAxisClosesmatplotlib#30164 and rearchitectsmatplotlib#29798.
@timhoffm
Copy link
MemberAuthor

I've simply updated the refrence image. As saidabove, other radial plots don't have the center 0 either. Therefore I claim the reference image was wrong. If we wanted to add the 0 back in, that'd need to be a systematic appoach.

@timhoffmtimhoffm added this to thev3.10.4 milestoneJul 12, 2025
@timhoffmtimhoffm merged commit1663e9a intomatplotlib:mainJul 12, 2025
39 of 40 checks passed
@timhoffmtimhoffm deleted the fix-radialaxis branchJuly 12, 2025 20:08
@lumberbot-appLumberbot (App)
Copy link

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v3.10.xgit pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 1663e9af1b63409f1a98b8ff6bc0c5c07b47054c
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #30174: FIX: Ensure Locators on RadialAxis are always correctly wrapped'
  1. Push to a named branch:
git push YOURFORK v3.10.x:auto-backport-of-pr-30174-on-v3.10.x
  1. Create a PR against branch v3.10.x, I would have named this PR:

"Backport PR#30174 on branch v3.10.x (FIX: Ensure Locators on RadialAxis are always correctly wrapped)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove theStill Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free tosuggest an improvement.

@timhoffm
Copy link
MemberAuthor

Not worth a manual backport. - I anticipate that 3.11 will be released in the not too far future, and a possible 3.10.4 will not be much earlier than that.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@anntzeranntzeranntzer left review comments

@dstansbydstansbydstansby approved these changes

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

Successfully merging this pull request may close these issues.

[Bug]: Removing spines in polar plot causes distortion of the plot
4 participants
@timhoffm@dstansby@QuLogic@anntzer

[8]ページ先頭

©2009-2025 Movatter.jp