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::grid.newpage()
grid.pattern_wave(x_hex, y_hex, colour = "black", type = "sine",
fill = c("red", "blue"), density = 0.4,
spacing = 0.15, angle = 0,
amplitude = 0.05, frequency = 1 / 0.20)
# zig-zag pattern is a wave of `type` "triangle"
grid::grid.newpage()
grid.pattern_wave(x_hex, y_hex, colour = "black", type = "triangle",
fill = c("red", "blue"), density = 0.4,
spacing = 0.15, angle = 0, amplitude = 0.075)
Run the code above in your browser using DataLab