Renders and saves a hex sticker ggplot object to a PNG file with a transparent background and the correct hexb.in aspect ratio (width / height = sqrt(3) / 2).
Arguments
- sticker
A ggplot object returned by
hex_sticker().- filename
Character. Output file path. Must end in
.png.- width
Integer. Width in pixels. Default
600.- dpi
Numeric. Resolution. Default
300.
See also
Other stickers:
hex_sticker(),
hexmakr_app(),
save_hex_svg()
Examples
# \donttest{
s <- hex_sticker("mypackage", icon = "atom", theme = "stats")
tmp <- tempfile(fileext = ".png")
save_hex(s, tmp)
file.exists(tmp)
#> [1] TRUE
# }