This is essentially the same issue as the one fixed by #29798, but uses set_yticks instead of set_rticks. I suspect that PolarAxes.set_yticks should get the same treatment (of wrapping into a RadialLocator); indeed, using set_rticks([]) works fine as of HEAD.
Actually, I think the proper solution must go deeper. In the end, this is a topic that should be handled within RadialAxis. The locator should always be wrapped in a RadialLocator, so I would say that set_major_locator should be overridden to ensure the wrapping.
but I'm unclear what the isDefault_majloc is doing and whether we need it. Also, this helper is called explicitly - do we still need that if RadialAxis.set_major_locator will do the wrapping? @QuLogic you seem to have introduced this in #9068 do you still remember?
Activity
anntzer commented on Jun 12, 2025
This is essentially the same issue as the one fixed by #29798, but uses set_yticks instead of set_rticks. I suspect that PolarAxes.set_yticks should get the same treatment (of wrapping into a RadialLocator); indeed, using set_rticks([]) works fine as of HEAD.
timhoffm commented on Jun 13, 2025
Fundamentally, shouldn't we implment everything in set_yticks and make set_rticks only a synonym of that?
anntzer commented on Jun 13, 2025
Yes, I would think so.
timhoffm commented on Jun 13, 2025
Actually, I think the proper solution must go deeper. In the end, this is a topic that should be handled within RadialAxis. The locator should always be wrapped in a RadialLocator, so I would say that set_major_locator should be overridden to ensure the wrapping.
There's already a helper function for wrapping:
matplotlib/lib/matplotlib/projections/polar.py
Lines 682 to 685 in f6b77d2
but I'm unclear what the isDefault_majloc is doing and whether we need it. Also, this helper is called explicitly - do we still need that if RadialAxis.set_major_locator will do the wrapping? @QuLogic you seem to have introduced this in #9068 do you still remember?
FIX: Ensure Locators on RadialAxis are always correctly wrapped
FIX: Ensure Locators on RadialAxis are always correctly wrapped
Fix issue matplotlib#30164: Removing spines in polar plot causing dis…
Issue matplotlib#30164: Removing spines causes distortion of the plot
Fix issue matplotlib#30164: Removing spines from polar plot causing d…
Fix issue matplotlib#30164: Removing spines from polar causing distor…
FIX: Ensure Locators on RadialAxis are always correctly wrapped