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

Skip to content

Commit 3fabd50

Browse files
committed
Merge pull request matplotlib#3453 from jenshnielsen/bbox_rebase_14
Bbox rebase 14
2 parents 08c41b1 + 17cc6dd commit 3fabd50

File tree

5 files changed

+245
-2
lines changed

5 files changed

+245
-2
lines changed
Binary file not shown.
Lines changed: 235 additions & 0 deletions
Loading

lib/matplotlib/tests/test_bbox_tight.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,15 @@ def test_bbox_inches_tight_clipping():
8484
path.vertices *= 0.25
8585
patch.set_clip_path(path, transform=ax.transAxes)
8686
plt.gcf().artists.append(patch)
87-
87+
88+
89+
@image_comparison(baseline_images=['bbox_inches_tight_raster'],
90+
remove_text=True, savefig_kwarg={'bbox_inches': 'tight'})
91+
def test_bbox_inches_tight_raster():
92+
"""Test rasterization with tight_layout"""
93+
fig = plt.figure()
94+
ax = fig.add_subplot(111)
95+
ax.plot([1.0, 2.0], rasterized=True)
8896

8997
if __name__ == '__main__':
9098
import nose

lib/matplotlib/tight_bbox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ def process_figure_for_rasterizing(fig, bbox_inches_restore, fixed_dpi=None):
8383

8484
bbox_inches, restore_bbox = bbox_inches_restore
8585
restore_bbox()
86-
r = adjust_bbox(figure, bbox_inches, fixed_dpi)
86+
r = adjust_bbox(fig, bbox_inches, fixed_dpi)
8787

8888
return bbox_inches, r

0 commit comments

Comments
 (0)