MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_hatching_legend

Function test_hatching_legend

lib/matplotlib/tests/test_backend_pdf.py:300–309  ·  view source on GitHub ↗

Test for correct hatching on patches in legend

(text_placeholders)

Source from the content-addressed store, hash-verified

298
299@image_comparison(['hatching_legend.pdf'], style='mpl20')
300def 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')

Callers

nothing calls this directly

Calls 3

RectangleClass · 0.90
figureMethod · 0.80
legendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…