Skip to content

Commit ed67aa3

Browse files
committed
Add test for new spine capstyle, workaround PDF rendering errors in low-dpi tests.
1 parent 3b9ef36 commit ed67aa3

File tree

8 files changed

+84
-530
lines changed

8 files changed

+84
-530
lines changed
Binary file not shown.

lib/matplotlib/tests/baseline_images/test_image/rasterize_10dpi.svg

+12-530
Loading
Binary file not shown.

lib/matplotlib/tests/test_image.py

+8
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,14 @@ def test_rasterize_dpi():
290290

291291
axes[2].plot([0,1],[0,1], linewidth=20.)
292292
axes[2].set(xlim = (0,1), ylim = (-1, 2))
293+
294+
# Low-dpi PDF rasterization errors prevent proper image comparison tests.
295+
# Hide detailed structures like the axes spines.
296+
for ax in axes:
297+
ax.set_xticks([])
298+
ax.set_yticks([])
299+
for spine in ax.spines.values():
300+
spine.set_visible(False)
293301

294302
rcParams['savefig.dpi'] = 10
295303

lib/matplotlib/tests/test_spines.py

+9
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,12 @@ def test_spines_data_positions():
3434
ax.spines['bottom'].set_position('zero')
3535
ax.set_xlim([-2,2])
3636
ax.set_ylim([-2,2])
37+
38+
@image_comparison(baseline_images=['spines_capstyle'])
39+
def test_spines_capstyle():
40+
# issue 2542
41+
plt.rc('axes', linewidth=20)
42+
fig = plt.figure()
43+
ax = fig.add_subplot(1,1,1)
44+
ax.set_xticks([])
45+
ax.set_yticks([])

0 commit comments

Comments
 (0)