(fig_test, fig_ref)
| 1406 | |
| 1407 | @check_figures_equal(extensions=['png', 'pdf', 'svg', 'eps']) |
| 1408 | def 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 | |
| 1430 | def test_collection_hatchcolor_inherit_logic(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…