Test for correct hatching on patches in legend
(text_placeholders)
| 298 | |
| 299 | @image_comparison(['hatching_legend.pdf'], style='mpl20') |
| 300 | def test_hatching_legend(text_placeholders): |
| 301 | """Test for correct hatching on patches in legend""" |
| 302 | fig = plt.figure(figsize=(1, 2)) |
| 303 | |
| 304 | a = Rectangle([0, 0], 0, 0, facecolor="green", hatch="XXXX") |
| 305 | b = Rectangle([0, 0], 0, 0, facecolor="blue", hatch="XXXX") |
| 306 | |
| 307 | # Verify that hatches in PDFs work after empty labels. See |
| 308 | # https://github.com/matplotlib/matplotlib/issues/4469 |
| 309 | fig.legend([a, b, a, b], ["", "", "", ""]) |
| 310 | |
| 311 | |
| 312 | @image_comparison(['grayscale_alpha.pdf'], style='_classic_test') |