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))
gp <- grid::gpar(colour = "black", fill = "lightblue", lwd=0.5)
# Plain weave (default weave)
grid.pattern_weave(x_hex, y_hex, fill2 = "yellow",
gp = gp, spacing = 0.1, density = 0.3)
# Irregular matt weave
grid::grid.newpage()
grid.pattern_weave(x_hex, y_hex, type = "matt_irregular",
fill2 = "yellow", gp = gp, spacing = 0.1, density = 0.3)
# Twill weave
grid::grid.newpage()
grid.pattern_weave(x_hex, y_hex, type = "twill",
fill2 = "yellow", gp = gp, spacing = 0.1, density = 0.3)
# Zig-zag twill
grid::grid.newpage()
grid.pattern_weave(x_hex, y_hex, type = "twill_zigzag",
fill2 = "yellow", gp = gp, spacing = 0.05, density = 0.7)
# Herringbone twill with density 1
grid::grid.newpage()
gp$col <- NA
grid.pattern_weave(x_hex, y_hex, type = "twill_herringbone",
fill2 = "yellow", gp = gp, spacing = 0.05, density = 1.0)
Run the code above in your browser using DataLab