Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit922cd71

Browse files
committed
FIX: errors in get_position changes
1 parentd5a4eda commit922cd71

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

‎lib/matplotlib/axes/_base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,9 @@ def get_position(self, original=False):
835835
iforiginal:
836836
returnself._originalPosition.frozen()
837837
else:
838-
self.apply_aspect()
838+
locator=self.get_axes_locator()
839+
ifnotlocator:
840+
self.apply_aspect()
839841
returnself._position.frozen()
840842

841843
defset_position(self,pos,which='both'):
@@ -857,7 +859,7 @@ def set_position(self, pos, which='both'):
857859
Determines which position variables to change.
858860
859861
"""
860-
self._set_position(pos,which='both')
862+
self._set_position(pos,which=which)
861863
# because this is being called externally to the library we
862864
# zero the constrained layout parts.
863865
self._layoutbox=None

‎lib/matplotlib/figure.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,10 +2296,10 @@ def get_tightbbox(self, renderer, bbox_extra_artists=None):
22962296
ifbboxisnotNoneand (bbox.width!=0orbbox.height!=0):
22972297
bb.append(bbox)
22982298

2299-
foraxinself.axes:
2300-
ifax.get_visible():
2301-
bb.append(ax.get_tightbbox(renderer,bbox_extra_artists))
2302-
2299+
[bb.append(ax.get_tightbbox(renderer,
2300+
bbox_extra_artists=bbox_extra_artists))
2301+
foraxinself.axesifax.get_visible()]
2302+
23032303
iflen(bb)==0:
23042304
returnself.bbox_inches
23052305

‎lib/mpl_toolkits/axes_grid1/axes_size.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ def __init__(self, ax, direction):
305305

306306
def__call__(self,renderer):
307307
get_func=self._get_func_map[self._direction]
308-
vl= [get_func(ax.get_tightbbox(renderer,False),ax.bbox)
308+
vl= [get_func(ax.get_tightbbox(renderer,call_axes_locator=False),
309+
ax.bbox)
309310
foraxinself._ax_list]
310311
returnmax(vl)

‎lib/mpl_toolkits/axes_grid1/parasite_axes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,10 @@ def _remove_method(h):
327327
returnax2
328328

329329
defget_tightbbox(self,renderer,call_axes_locator=True):
330-
bbs= [ax.get_tightbbox(renderer,call_axes_locator)
330+
bbs= [ax.get_tightbbox(renderer,call_axes_locator=call_axes_locator)
331331
foraxinself.parasites]
332-
bbs.append(super().get_tightbbox(renderer,call_axes_locator))
332+
bbs.append(super().get_tightbbox(renderer,
333+
call_axes_locator=call_axes_locator))
333334
returnBbox.union([bforbinbbsifb.width!=0orb.height!=0])
334335

335336

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp