Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace _autoscaleX_on with get_autoscalex_on() in GeoAxes #2054

Merged
merged 1 commit into from
Jun 28, 2022
Merged
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
11 changes: 6 additions & 5 deletions lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,15 +462,16 @@ def hold_limits(self, hold=True):
data_lim = self.dataLim.frozen().get_points()
view_lim = self.viewLim.frozen().get_points()
other = (self.ignore_existing_data_limits,
self._autoscaleXon, self._autoscaleYon)
self.get_autoscalex_on(), self.get_autoscaley_on())
try:
yield
finally:
if hold:
self.dataLim.set_points(data_lim)
self.viewLim.set_points(view_lim)
(self.ignore_existing_data_limits,
self._autoscaleXon, self._autoscaleYon) = other
self.ignore_existing_data_limits = other[0]
self.set_autoscalex_on(other[1])
self.set_autoscaley_on(other[2])

def _draw_preprocess(self, renderer):
"""
Expand Down Expand Up @@ -881,11 +882,11 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
"""
super().autoscale_view(tight=tight, scalex=scalex, scaley=scaley)
# Limit the resulting bounds to valid area.
if scalex and self._autoscaleXon:
if scalex and self.get_autoscalex_on():
bounds = self.get_xbound()
self.set_xbound(max(bounds[0], self.projection.x_limits[0]),
min(bounds[1], self.projection.x_limits[1]))
if scaley and self._autoscaleYon:
if scaley and self.get_autoscaley_on():
bounds = self.get_ybound()
self.set_ybound(max(bounds[0], self.projection.y_limits[0]),
min(bounds[1], self.projection.y_limits[1]))
Expand Down