Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/api/next_api_changes/deprecations/30469-AL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The *axes* parameter of ``RadialLocator``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... is deprecated. `~.polar.RadialLocator` now fetches the relevant information
from the Axis' parent Axes.
15 changes: 8 additions & 7 deletions lib/matplotlib/projections/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ class RadialLocator(mticker.Locator):
scale of the *r*-axis).
"""

@_api.delete_parameter("3.11", "axes")
def __init__(self, base, axes=None):
self.base = base
self._axes = axes
Expand All @@ -440,19 +441,19 @@ def set_axis(self, axis):

def __call__(self):
# Ensure previous behaviour with full circle non-annular views.
if self._axes:
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]
ax = self.base.axis.axes
if _is_full_circle_rad(*ax.viewLim.intervalx):
rorigin = ax.get_rorigin() * ax.get_rsign()
if ax.get_rmin() <= rorigin:
return [tick for tick in self.base() if tick > rorigin]
return self.base()

def _zero_in_bounds(self):
"""
Return True if zero is within the valid values for the
scale of the radial axis.
"""
vmin, vmax = self._axes.yaxis._scale.limit_range_for_scale(0, 1, 1e-5)
vmin, vmax = self.base.axis._scale.limit_range_for_scale(0, 1, 1e-5)
return vmin == 0

def nonsingular(self, vmin, vmax):
Expand Down Expand Up @@ -681,7 +682,7 @@ def __init__(self, *args, **kwargs):

def set_major_locator(self, locator):
if not isinstance(locator, RadialLocator):
locator = RadialLocator(locator, self.axes)
locator = RadialLocator(locator)
super().set_major_locator(locator)

def clear(self):
Expand Down
Loading