Skip to content

Commit

Permalink
FIX: Apply aspect before drawing starts
Browse files Browse the repository at this point in the history
  • Loading branch information
jklymak committed Nov 5, 2018
1 parent e2625d0 commit b39bd9d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
17 changes: 17 additions & 0 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b39bd9d

Please sign in to comment.