Create Hexagon Sticker in R

Helper functions for creating reproducible hexagon sticker purely in R.


CRAN_Status_Badge

Author

Guangchuang YU https://guangchuangyu.github.io

School of Public Health, The University of Hong Kong


Examples

library(hexSticker)
sticker(expression(plot(cars, cex=.5, cex.axis=.5, mgp=c(0,.3,0), xlab="", ylab="")),
        package="hexSticker", p_size=8, s_x=1, s_y=.8, s_width=1.2, s_height=1,
        filename="inst/figures/baseplot.png")

lattice

library(lattice)
 
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)
bwplot <- bwplot(counts ~ outcome | treatment, xlab=NULL, ylab=NULL, cex=.5,
                 scales=list(cex=.5), par.strip.text=list(cex=.5))
sticker(bwplot, package="hexSticker", p_size=8, s_x=1.05, s_y=.75, s_width=2, s_height=1.5,
        h_fill="#f9690e", h_color="#f39c12", filename="inst/figures/lattice.png")

ggplot2

library(ggplot2)
 
p <- ggplot(aes(x = mpg, y = wt), data = mtcars) + geom_point()
p <- p + theme_void() + theme_transparent()
 
sticker(p, package="hexSticker", p_size=8, s_x=1, s_y=.75, s_width=1.3, s_height=1,
        filename="inst/figures/ggplot2.png")

image file

imgurl <- "http://www.belleamibengals.com/bengal_cat_2.png"
sticker(imgurl, package="hexSticker", p_size=8, s_x=1, s_y=.75, s_width=.6,
        filename="inst/figures/imgfile.png")

Stickers produced by hexSticker

If you use hexSticker and want your sticker to be listed here, please feel free to edit README.Rmd.

Stickers for software packages

Stickers for events/workshops

Stickers for fun

Print/order stickers

Sticker designers can make their stickers available via Sticker Mule.

News

CHANGES IN VERSION 0.4.2

o update code according to the change of geom_subview <2017-11-22, Wed>

CHANGES IN VERSION 0.4.0

o remove ggforce dependency <2017-06-19, Mon>

CHANGES IN VERSION 0.3.0

o URL at lower border of sticker <2017-04-19, Wed>

CHANGES IN VERSION 0.2.1

o bug fixed of whiteTrans <2017-04-19, Wed>

CHANGES IN VERSION 0.2.0

o support spotlight <2017-04-05, Wed>

CHANGES IN VERSION 0.1.0

o geom_hexagon, geom_pkgname, theme_sticker <2017-03-21, Tue> o use ggimage::geom_subview and ggimage::geom_image <2017-03-21, Tue>

CHANGES IN VERSION 0.0.2

o support select font typeface <2017-03-15, Wed>

CHANGES IN VERSION 0.0.1

o initial version based on my script to generate ggtree sticker <2017-03-13, Mon>

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("hexSticker")

0.4.2 by Guangchuang Yu, 2 months ago


https://github.com/GuangchuangYu/hexSticker


Report a bug at https://github.com/GuangchuangYu/hexSticker/issues


Browse source code at https://github.com/cran/hexSticker


Authors: Guangchuang Yu [aut, cre], Laurent Gatto [ctb], Johannes Rainer [ctb], Sebastian Gibb [ctb]


Documentation:   PDF Manual  


Artistic-2.0 license


Imports ggimage, ggplot2, grDevices, hexbin, showtext, stats, sysfonts


Imported by GRANBase.


See at CRAN