Skip to content

Commit fa58bde

Browse files
committed
add a test case of test_prevent_rasterization
1 parent e83ff55 commit fa58bde

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/matplotlib/tests/test_backend_svg.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,27 @@ def test_rasterized_ordering(fig_test, fig_ref):
122122
ax_test.plot(x+1, y, "-", c="b", lw=10, rasterized=False, zorder=1.2)
123123

124124

125+
@check_figures_equal(tol=5)
126+
def test_prevent_rasterization(fig_test, fig_ref):
127+
loc = [0.05, 0.05]
128+
129+
ax_ref = fig_ref.subplots()
130+
131+
ax_ref.plot([loc[0]], [loc[1]], marker="x", c="black", zorder=2)
132+
133+
b = mpl.offsetbox.TextArea("X")
134+
abox = mpl.offsetbox.AnnotationBbox(b, loc, zorder=2.1)
135+
ax_ref.add_artist(abox)
136+
137+
ax_test = fig_test.subplots()
138+
ax_test.plot([loc[0]], [loc[1]], marker="x", c="black", zorder=2,
139+
rasterized=True)
140+
141+
b = mpl.offsetbox.TextArea("X")
142+
abox = mpl.offsetbox.AnnotationBbox(b, loc, zorder=2.1)
143+
ax_test.add_artist(abox)
144+
145+
125146
def test_count_bitmaps():
126147
def count_tag(fig, tag):
127148
with BytesIO() as fd:

0 commit comments

Comments
 (0)