Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a new PDF backend test for hatching changes
  • Loading branch information
James Pallister committed May 26, 2015
commit 7fff74dd9ee661c465e601d4efe65a0c3b14557c
Binary file not shown.
11 changes: 11 additions & 0 deletions lib/matplotlib/tests/test_backend_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,14 @@ def test_composite_image():
with PdfPages(io.BytesIO()) as pdf:
fig.savefig(pdf, format="pdf")
assert len(pdf._file.images.keys()) == 2

@image_comparison(baseline_images=['hatching_legend'],
extensions=['pdf'])
def test_hatching_legend():
"""Test for correct hatching on patches in legend"""
fig = plt.figure(figsize=(1,2))

a = plt.Rectangle([0,0], 0, 0, facecolor="green", hatch="XXXX")
b = plt.Rectangle([0,0], 0, 0, facecolor="blue", hatch="XXXX")

fig.legend([a,b,a,b], ["","","",""])