View source: R/pattern-both-hatch.R
| grid.pattern_hatch | R Documentation |
grid.pattern_hatch() draws a heraldic color hatching patterns onto the graphic device.
names_hatch() returns a character vector of supported type values.
grid.pattern_hatch(
x = c(0, 0, 1, 1),
y = c(1, 0, 0, 1),
id = 1L,
...,
type = "gules",
subtype = "combinatorial",
colour = gp$col %||% "grey20",
spacing = 0.05,
xoffset = 0,
yoffset = 0,
units = "snpc",
alpha = gp$alpha %||% NA_real_,
lineend = gp$lineend %||% "round",
linewidth = size %||% gp$lwd %||% 1,
size = NULL,
use_R4.1_masks = getOption("ggpattern_use_R4.1_masks",
getOption("ggpattern_use_R4.1_features")),
png_device = NULL,
res = getOption("ggpattern_res", 72),
default.units = "npc",
name = NULL,
gp = gpar(),
draw = TRUE,
vp = NULL
)
names_hatch(
subtype = c("combinatorial", "fox-davies", "goodman", "unicode"),
accent = FALSE
)
x |
A numeric vector or unit object specifying x-locations of the pattern boundary. |
y |
A numeric vector or unit object specifying y-locations of the pattern boundary. |
id |
A numeric vector used to separate locations in x, y into multiple boundaries.
All locations within the same |
... |
Currently ignored. |
type |
A tincture or color name. |
subtype |
A string with one of
The string is case-insensitive and hyphens and spaces are ignored. |
colour |
Stroke colour(s). |
spacing |
Spacing between repetitions of pattern (in |
xoffset |
Shift pattern along x axis (in |
yoffset |
Shift pattern along y axis (in |
units |
|
alpha |
Alpha (between 0 and 1) or |
lineend |
Line end style, one of |
linewidth |
Stroke linewidth. |
size |
For backwards compatibility can be used to set |
use_R4.1_masks |
If |
png_device |
“png” graphics device to save intermediate raster data with if |
res |
Resolution of desired |
default.units |
A string indicating the default units to use if |
name |
A character identifier. |
gp |
An object of class |
draw |
A logical value indicating whether graphics output should be produced. |
vp |
A Grid viewport object (or NULL). |
accent |
If |
A grid grob object invisibly. If draw is TRUE then also draws to the graphic device as a side effect.
grid.pattern_line() for single-direction lines,
grid.pattern_crosshatch() for perpendicular lines.
vignette("hatching", package = "gridpattern") for a visual overview of all subtypes.
https://en.wikisource.org/wiki/A_Complete_Guide_to_Heraldry/Chapter_7#74 for Fox-Davies'
A Complete Guide to Heraldry.
https://david.goodman.graphics/portfolio/item/crests-heraldry-and-coats-of-arms/ for
David Goodman's Heraldic Tincture reference.
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))
if (capabilities("png") || guess_has_R4.1_features("masks")) {
grid::grid.newpage()
grid.pattern_hatch(x_hex, y_hex, type = "azure", colour = "blue")
}
if (capabilities("png") || guess_has_R4.1_features("masks")) {
grid::grid.newpage()
grid.pattern_hatch(x_hex, y_hex, type = "cendree", colour = "grey", spacing = 0.1)
}
print(names_hatch())
print(names_hatch("fox-davies"))
print(names_hatch("goodman"))
print(names_hatch("unicode"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.