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

Function test_hatch_linewidth

lib/matplotlib/tests/test_collections.py:1408–1427  ·  view source on GitHub ↗
(fig_test, fig_ref)

Source from the content-addressed store, hash-verified

1406
1407@check_figures_equal(extensions=['png', 'pdf', 'svg', 'eps'])
1408def test_hatch_linewidth(fig_test, fig_ref):
1409 ax_test = fig_test.add_subplot()
1410 ax_ref = fig_ref.add_subplot()
1411
1412 lw = 2.0
1413
1414 polygons = [
1415 [(0.1, 0.1), (0.1, 0.4), (0.4, 0.4), (0.4, 0.1)],
1416 [(0.6, 0.6), (0.6, 0.9), (0.9, 0.9), (0.9, 0.6)],
1417 ]
1418 ref = PolyCollection(polygons, hatch="x")
1419 ref.set_hatch_linewidth(lw)
1420
1421 with mpl.rc_context({"hatch.linewidth": lw}):
1422 test = PolyCollection(polygons, hatch="x")
1423
1424 ax_ref.add_collection(ref)
1425 ax_test.add_collection(test)
1426
1427 assert test.get_hatch_linewidth() == ref.get_hatch_linewidth() == lw
1428
1429
1430def test_collection_hatchcolor_inherit_logic():

Callers

nothing calls this directly

Calls 5

PolyCollectionClass · 0.90
add_subplotMethod · 0.80
add_collectionMethod · 0.80
set_hatch_linewidthMethod · 0.45
get_hatch_linewidthMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…