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

Skip to content

Commit 895e4d0

Browse files
committed
ENH: make get_position apply aspect
1 parent 3c1f423 commit 895e4d0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ def get_position(self, original=False):
859859
if original:
860860
return self._originalPosition.frozen()
861861
else:
862+
self.apply_aspect()
862863
return self._position.frozen()
863864

864865
def set_position(self, pos, which='both'):

lib/matplotlib/colorbar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
11641164

11651165
# transform each of the axes in parents using the new transform
11661166
for ax in parents:
1167-
new_posn = shrinking_trans.transform(ax.get_position())
1167+
new_posn = shrinking_trans.transform(ax.get_position(original=True))
11681168
new_posn = mtransforms.Bbox(new_posn)
11691169
ax.set_position(new_posn)
11701170
if parent_anchor is not False:

0 commit comments

Comments
 (0)