Fills a shape with ruled parallel lines. Unlike vl_pattern(), which
rasterises a tile, a hatch is geometry: it stays crisp at any zoom, prints
correctly, and survives being converted to greyscale.
Arguments
- angle
Direction of the rules, in degrees counter-clockwise from horizontal. Distinct angles (0, 45, 90, 135) read as distinct categories.
- spacing
Distance between rules, in points.
- width
Rule width, in points.
- col
Rule colour.
- bg
Optional background painted behind the rules.
NA(default) leaves whatever is underneath showing through.
Details
That last point is the reason to reach for it. A colour encoding that fails
for a red/green-blind reader — which render()'s cvd argument will show you
and vl_lint() will flag — is fixed by encoding with texture as well as
hue. Hatching is the standard way to do that.
See also
vl_pattern() for a tiled grob, linear_gradient(), vl_lint()

