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

Skip to content

Commit 2e02f9b

Browse files
committed
FIX
1 parent 72f4046 commit 2e02f9b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/matplotlib/colorbar.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,9 @@ def __call__(self, ax, renderer):
260260
offset = extendlen[0] / len
261261
# we need to reset the aspect ratio of the axes to account
262262
# of the extends...
263-
if hasattr(ax, '_colorbar_info'):
264-
aspect = ax._colorbar_info['aspect']
265-
else:
266-
aspect = False
263+
264+
aspect = ax.get_box_aspect()
265+
ax._colorbar_info['aspect'] = aspect
267266
# now shrink and/or offset to take into account the
268267
# extend tri/rectangles.
269268
if self._cbar.orientation == 'vertical':
@@ -1467,7 +1466,6 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
14671466
anchor=anchor,
14681467
panchor=panchor,
14691468
fraction=fraction,
1470-
aspect=aspect0,
14711469
pad=pad)
14721470
# and we need to set the aspect ratio by hand...
14731471
cax.set_anchor(anchor)

0 commit comments

Comments
 (0)