Closed trevorld closed 2 years ago
Prof. Murrell claims that the limit on masks on Cairo devices should be lifted in r-devel.
I've manually confirmed that the limit on masks on Cairo devices seems to be lifted in R-devel so this bug should go away after users upgrade to R 4.2.
Bug description
When drawing detailed maps with
geom_sf_pattern()
in a Cairo graphics device with R 4.1 clipping enabled one may seeand the patterns are not properly clipped.
Minimal, reproducible example
Workarounds
1) Use
ragg::agg_png()
orgrDevices::pdf()
instead2) Set
options(ggpattern_use_R4.1_masks = FALSE)
to use the raster masking alternative to the R 4.1 masking feature3) Upgrade to R 4.2.0 (
r-devel
) where this limit on alpha masks should be lifted.Possible future fixes
If we could easily figure which
{sf}
shape are polygons without holes and which are we could use a normal pattern grob for the ones without holes instead of always using a clipping path grob and this would put less clipping pressure on Cairo and hopefully reduce such warnings.