Skip to content

Commit 7fff74d

Browse files
author
James Pallister
committed
Add a new PDF backend test for hatching changes
1 parent 232c50d commit 7fff74d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Binary file not shown.

lib/matplotlib/tests/test_backend_pdf.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,14 @@ def test_composite_image():
107107
with PdfPages(io.BytesIO()) as pdf:
108108
fig.savefig(pdf, format="pdf")
109109
assert len(pdf._file.images.keys()) == 2
110+
111+
@image_comparison(baseline_images=['hatching_legend'],
112+
extensions=['pdf'])
113+
def test_hatching_legend():
114+
"""Test for correct hatching on patches in legend"""
115+
fig = plt.figure(figsize=(1,2))
116+
117+
a = plt.Rectangle([0,0], 0, 0, facecolor="green", hatch="XXXX")
118+
b = plt.Rectangle([0,0], 0, 0, facecolor="blue", hatch="XXXX")
119+
120+
fig.legend([a,b,a,b], ["","","",""])

0 commit comments

Comments
 (0)