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

Skip to content

Commit 5e9083d

Browse files
committed
Test mixed-mode renderer with tight bbox_inches.
1 parent a5bb90a commit 5e9083d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/matplotlib/tests/test_bbox_tight.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,13 @@ def test_noop_tight_bbox():
125125
ax.get_yaxis().set_visible(False)
126126

127127
data = np.arange(x_size * y_size).reshape(y_size, x_size)
128-
ax.imshow(data)
128+
ax.imshow(data, rasterized=True)
129+
130+
# When a rasterized Artist is included, a mixed-mode renderer does
131+
# additional bbox adjustment. It should also be a no-op, and not affect the
132+
# next save.
133+
fig.savefig(BytesIO(), bbox_inches='tight', pad_inches=0, format='pdf')
134+
129135
out = BytesIO()
130136
fig.savefig(out, bbox_inches='tight', pad_inches=0)
131137
out.seek(0)

0 commit comments

Comments
 (0)