| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 01a4e9f commit 11fdbbd
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,8 +17,6 @@ def adjust_bbox(fig, bbox_inches, fixed_dpi=None): | |||
| 17 | 17 | """ | |
| 18 | 18 | origBbox = fig.bbox | |
| 19 | 19 | origBboxInches = fig.bbox_inches | |
| 20 | - orig_layout = fig.get_layout_engine() | ||
| 21 | - fig.set_layout_engine(None) | ||
| 22 | 20 | _boxout = fig.transFigure._boxout | |
| 23 | 21 | ||
| 24 | 22 | old_aspect = [] | |
@@ -46,7 +44,6 @@ def restore_bbox(): | |||
| 46 | 44 | ||
| 47 | 45 | fig.bbox = origBbox | |
| 48 | 46 | fig.bbox_inches = origBboxInches | |
| 49 | - fig.set_layout_engine(orig_layout) | ||
| 50 | 47 | fig.transFigure._boxout = _boxout | |
| 51 | 48 | fig.transFigure.invalidate() | |
| 52 | 49 | fig.patch.set_bounds(0, 0, 1, 1) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -532,6 +532,13 @@ def test_savefig_pixel_ratio(backend): | |||
| 532 | 532 | assert ratio1 == ratio2 | |
| 533 | 533 | ||
| 534 | 534 | ||
| 535 | + def test_savefig_preserve_layout_engine(tmp_path): | ||
| 536 | + fig = plt.figure(layout='compressed') | ||
| 537 | + fig.savefig(tmp_path / 'foo.png', bbox_inches='tight') | ||
| 538 | + | ||
| 539 | + assert fig.get_layout_engine()._compress | ||
| 540 | + | ||
| 541 | + | ||
| 535 | 542 | def test_figure_repr(): | |
| 536 | 543 | fig = plt.figure(figsize=(10, 20), dpi=10) | |
| 537 | 544 | assert repr(fig) == "<Figure size 100x200 with 0 Axes>" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments