Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff77eaa

Browse files
committed
FIX
1 parent 924a377 commit ff77eaa

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/matplotlib/figure.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2052,6 +2052,7 @@ def draw(self, renderer):
20522052

20532053
finally:
20542054
self.stale = False
2055+
print('Drawing sub')
20552056

20562057

20572058

@@ -2682,13 +2683,14 @@ def clear(self, keep_observers=False):
26822683
def draw(self, renderer):
26832684
# docstring inherited
26842685
self._cachedRenderer = renderer
2686+
"Drawing Figure"
26852687

26862688
# draw the figure bounding box, perhaps none for white figure
26872689
if not self.get_visible():
26882690
return
26892691

26902692
artists = self._get_draw_artists(renderer)
2691-
2693+
26922694
try:
26932695
renderer.open_group('figure', gid=self.get_gid())
26942696
if self.get_constrained_layout() and self.axes:

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,11 @@ def apply_aspect(self, position=None):
407407
# in the superclass, we would go through and actually deal with axis
408408
# scales and box/datalim. Those are all irrelevant - all we need to do
409409
# is make sure our coordinate system is square.
410-
figW, figH = self.get_figure().get_size_inches()
411-
fig_aspect = figH / figW
410+
trans = self.get_figure().transPanel
411+
bb = mtransforms.Bbox.from_bounds(0, 0, 1, 1).transformed(trans)
412+
# this is the physical aspect of the panel (or figure):
413+
fig_aspect = bb.height / bb.width
414+
412415
box_aspect = 1
413416
pb = position.frozen()
414417
pb1 = pb.shrunk_to_aspect(box_aspect, pb, fig_aspect)
@@ -463,6 +466,7 @@ def draw(self, renderer):
463466
axis.draw(renderer)
464467

465468
# Then rest
469+
print("draw")
466470
super().draw(renderer)
467471

468472
def get_axis_position(self):

0 commit comments

Comments
 (0)