diff --git a/lib/matplotlib/axes/_base.py b/lib/matplotlib/axes/_base.py index cd6a5843f424..89896cd6aac9 100644 --- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -2546,12 +2546,6 @@ def draw(self, renderer=None, inframe=False): # prevent triggering call backs during the draw process self._stale = True - locator = self.get_axes_locator() - if locator: - pos = locator(self, renderer) - self.apply_aspect(pos) - else: - self.apply_aspect() artists = self.get_children() artists.remove(self.patch) diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py index c86672c95dc9..6b61237ae1e0 100644 --- a/lib/matplotlib/figure.py +++ b/lib/matplotlib/figure.py @@ -1630,6 +1630,23 @@ def draw(self, renderer): if not artist.get_animated()), key=lambda artist: artist.get_zorder()) + for ax in self.axes: + locator = ax.get_axes_locator() + if locator: + pos = locator(ax, renderer) + ax.apply_aspect(pos) + else: + ax.apply_aspect() + + for child in ax.get_children(): + if hasattr(child, 'apply_aspect'): + locator = child.get_axes_locator() + if locator: + pos = locator(child, renderer) + child.apply_aspect(pos) + else: + child.apply_aspect() + try: renderer.open_group('figure') if self.get_constrained_layout() and self.axes: