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

Appearance settings

Commit 5698d3f

Browse filesBrowse files
authored
Merge pull request #11777 from fredrik-1/warning_savefig
Avoid incorrect warning in savefig
2 parents 9857e7c + a16c065 commit 5698d3f
Copy full SHA for 5698d3f

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed

‎lib/matplotlib/tight_bbox.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tight_bbox.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ def adjust_bbox(fig, bbox_inches, fixed_dpi=None):
1818

1919
origBbox = fig.bbox
2020
origBboxInches = fig.bbox_inches
21+
orig_tight_layout = fig.get_tight_layout()
2122
_boxout = fig.transFigure._boxout
2223

24+
fig.set_tight_layout(False)
25+
2326
asp_list = []
2427
locator_list = []
2528
for ax in fig.axes:
@@ -33,13 +36,13 @@ def _l(a, r, pos=pos):
3336
ax.set_aspect("auto")
3437

3538
def restore_bbox():
36-
3739
for ax, asp, loc in zip(fig.axes, asp_list, locator_list):
3840
ax.set_aspect(asp)
3941
ax.set_axes_locator(loc)
4042

4143
fig.bbox = origBbox
4244
fig.bbox_inches = origBboxInches
45+
fig.set_tight_layout(orig_tight_layout)
4346
fig.transFigure._boxout = _boxout
4447
fig.transFigure.invalidate()
4548
fig.patch.set_bounds(0, 0, 1, 1)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.