library(ggplot2)
hex <- data.frame(
x = cos(seq(0, 2 * pi, length.out = 7))[-7],
y = sin(seq(0, 2 * pi, length.out = 7))[-7]
)
regions <- do.call(rbind, lapply(1:3, function(k) {
transform(hex, x = x + (k - 1) * 2.3, g = k, val = k)
}))
# `val` is rescaled to the default tone band c(0.15, 0.95) automatically.
ggplot(regions, aes(x, y, group = g)) +
geom_sketch_shade(aes(tone = val), seed = 1L) +
coord_equal()
# Push the darkest region all the way to solid black.
ggplot(regions, aes(x, y, group = g)) +
geom_sketch_shade(aes(tone = val), seed = 1L) +
scale_tone_continuous(range = c(0.15, 1)) +
coord_equal()
Run the code above in your browser using DataLab