@@ -1453,3 +1453,36 @@ def test_collection_hatchcolor_fallback_logic():
14531453 col = PathCollection ([path ], hatch = '//' )
14541454 assert_array_equal (col .get_hatchcolor (),
14551455 mpl .colors .to_rgba_array (mpl .rcParams ['patch.edgecolor' ]))
1456+
1457+
1458+ @pytest .mark .parametrize ('backend' , ['agg' , 'pdf' , 'svg' , 'ps' ])
1459+ def test_draw_path_collection_no_hatchcolor (backend ):
1460+ from matplotlib .collections import PathCollection
1461+ path = mpath .Path .unit_rectangle ()
1462+
1463+ plt .switch_backend (backend )
1464+ fig , ax = plt .subplots ()
1465+ renderer = fig ._get_renderer ()
1466+
1467+ col = PathCollection ([path ], hatch = '//' )
1468+ ax .add_collection (col )
1469+
1470+ gc = renderer .new_gc ()
1471+ transform = mtransforms .IdentityTransform ()
1472+ paths = col .get_paths ()
1473+ transforms = col .get_transforms ()
1474+ offsets = col .get_offsets ()
1475+ offset_trf = col .get_offset_transform ()
1476+ facecolors = col .get_facecolor ()
1477+ edgecolors = col .get_edgecolor ()
1478+ linewidths = col .get_linewidth ()
1479+ linestyles = col .get_linestyle ()
1480+ antialiaseds = col .get_antialiased ()
1481+ urls = col .get_urls ()
1482+ offset_position = "screen"
1483+
1484+ renderer .draw_path_collection (
1485+ gc , transform , paths , transforms , offsets , offset_trf ,
1486+ facecolors , edgecolors , linewidths , linestyles ,
1487+ antialiaseds , urls , offset_position
1488+ )
0 commit comments