8000 FIX: Apply aspect before drawing starts · matplotlib/matplotlib@69fd1fc · GitHub
[go: up one dir, main page]

Skip to content

Commit 69fd1fc

Browse files
committed
FIX: Apply aspect before drawing starts
1 parent 6b4048d commit 69fd1fc

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2553,12 +2553,6 @@ def draw(self, renderer=None, inframe=False):
25532553

25542554
# prevent triggering call backs during the draw process
25552555
self._stale = True
2556-
locator = self.get_axes_locator()
2557-
if locator:
2558-
pos = locator(self, renderer)
2559-
self.apply_aspect(pos)
2560-
else:
2561-
self.apply_aspect()
25622556

25632557
artists = self.get_children()
25642558
artists.remove(self.patch)

lib/matplotlib/figure.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,23 @@ def draw(self, renderer):
16271627
if not artist.get_animated()),
16281628
key=lambda artist: artist.get_zorder())
16291629

1630+
for ax in self.axes:
1631+
locator = ax.get_axes_locator()
1632+
if locator:
1633+
pos = locator(ax, renderer)
1634+
ax.apply_aspect(pos)
1635+
else:
1636+
ax.apply_aspect()
1637+
1638+
for child in ax.get_children():
1639+
if hasattr(child, 'apply_aspect'):
1640+
locator = child.get_axes_locator()
1641+
if locator:
1642+
pos = locator(child, renderer)
1643+
child.apply_aspect(pos)
1644+
else:
1645+
child.apply_aspect()
1646+
16301647
try:
16311648
renderer.open_group('figure')
16321649
if self.get_constrained_layout() and self.axes:

0 commit comments

Comments
 (0)
0