Skip to content

Possible fix for hatching problems inside legends (PDF backend) #4474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 16, 2015
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], ["","","",""])