Skip to content
Open
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
9 changes: 8 additions & 1 deletion lib/matplotlib/projections/polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ class RadialLocator(mticker.Locator):
def __init__(self, base, axes=None):
self.base = base
self._axes = axes
self._zero_in_bounds_cache = None

def set_axis(self, axis):
self.base.set_axis(axis)
Expand All @@ -498,8 +499,14 @@ def _zero_in_bounds(self):
Return True if zero is within the valid values for the
scale of the radial axis.
"""
if self._zero_in_bounds_cache is not None:
cached_axes, cached_result = self._zero_in_bounds_cache
if cached_axes is self._axes:
return cached_result
vmin, vmax = self._axes.yaxis._scale.limit_range_for_scale(0, 1, 1e-5)
return vmin == 0
result = vmin == 0
self._zero_in_bounds_cache = (self._axes, result)
return result

def nonsingular(self, vmin, vmax):
# docstring inherited
Expand Down