x_hex <- 0.5 + 0.5 * cos(seq(2 * pi / 4, by = 2 * pi / 6, length.out = 6))
y_hex <- 0.5 + 0.5 * sin(seq(2 * pi / 4, by = 2 * pi / 6, length.out = 6))
grid.pattern_fill(x_hex, y_hex, fill = "blue")
if (guess_has_R4.1_features("patterns")) {
grid::grid.newpage()
stripe_fill <- patternFill("stripe", fill = c("red", "blue"))
grid.pattern_fill(x_hex, y_hex, fill = stripe_fill)
}
Run the code above in your browser using DataLab