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

Skip to content

Commit 228f15c

Browse files
committed
Some fixes for aspect ratios and interactive use
1 parent 10e551c commit 228f15c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/matplotlib/colorbar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ def remove(self):
10521052
except AttributeError:
10531053
# use_gridspec was False
10541054
pos = ax.get_position(original=True)
1055-
ax.set_position(pos)
1055+
ax._set_position(pos)
10561056
else:
10571057
# use_gridspec was True
10581058
ax.set_subplotspec(subplotspec)
@@ -1296,7 +1296,7 @@ def make_axes_gridspec(parent, **kw):
12961296

12971297
parent.set_subplotspec(gs[0])
12981298
parent.update_params()
1299-
parent.set_position(parent.figbox)
1299+
parent._set_position(parent.figbox)
13001300
parent.set_anchor(panchor)
13011301

13021302
fig = parent.get_figure()

lib/matplotlib/gridspec.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,16 @@ def update(self, **kwargs):
254254
if isinstance(ax._sharex, mpl.axes.SubplotBase):
255255
if ax._sharex.get_subplotspec().get_gridspec() == self:
256256
ax._sharex.update_params()
257-
ax.set_position(ax._sharex.figbox)
257+
ax._set_position(ax._sharex.figbox)
258258
elif isinstance(ax._sharey, mpl.axes.SubplotBase):
259259
if ax._sharey.get_subplotspec().get_gridspec() == self:
260260
ax._sharey.update_params()
261-
ax.set_position(ax._sharey.figbox)
261+
ax._set_position(ax._sharey.figbox)
262262
else:
263263
ss = ax.get_subplotspec().get_topmost_subplotspec()
264264
if ss.get_gridspec() == self:
265265
ax.update_params()
266-
ax.set_position(ax.figbox)
266+
ax._set_position(ax.figbox)
267267

268268
def get_subplot_params(self, figure=None, fig=None):
269269
"""

0 commit comments

Comments
 (0)