Adds a sketchy wobble with automatic scaling and panel masking.
Arguments
- x
ggplot/grob or magick-image
- width, height, dpi
Used when x is ggplot/grob
- scale
numeric px or "auto" (default)
- strength
0..1 intensity when
scale="auto"
(default 0.7)- freq
noise frequency (0.2 broad … 1.2 fine)
- seed
RNG seed
- affect_text
if FALSE, confine warp to panel region
- focus
"panel" (default if ggplot), "full", or "auto_image"
- expand_px
integer px to expand the panel box (ggplot path)
- edge_guard
fade warp near canvas edges (0..0.2)
- fill_bg
final background (e.g., "white" or "transparent")
Examples
if (FALSE) { # \dontrun{
if (requireNamespace("ggplot2", quietly = TRUE)) {
p <- ggplot2::ggplot(mtcars, ggplot2::aes(wt, mpg)) + ggplot2::geom_point()
hand_drawn_wiggle(p)
}
} # }