GuangchuangYu / hexSticker

:sparkles: Hexagon sticker in R
757 stars 167 forks source link

version 0.1.0 #6

Closed GuangchuangYu closed 7 years ago

GuangchuangYu commented 7 years ago

ggtree::subview now moved to ggimage::geom_subview and ggtree::theme_transparent move to ggimage::theme_transparent.

The width and height are now not proportion to the plot, but in native unit.

Here is an example:

library(ggimage)
d=tibble::data_frame(x=1:3, y=1:3, z=LETTERS[1:3])
d$bar = lapply(1:nrow(d), function(i) ggplot(d[i,], aes(z, y)) + geom_col())
ggplot() + xlim(0, 4) + ylim(0,4) + geom_subview(d$bar, x=d$x, y=d$y, width=1, height=1)

screen shot 2017-03-21 at 2 25 00 pm

Sorry for changing the unit and break your codes again. 😂

In this new version, I have split the sticker function to several layer.

Now we can use the following command to generate sticker:

ggplot() + geom_hexagon() + geom_subview() + geom_pkgname() + theme_sticker()

hexagon is a short cut for ggplot() + geom_hexagon() + theme_sticker().

see https://github.com/GuangchuangYu/hexSticker/commit/9828a7899e5144395a361cdc599d2ed738b77cda.

@lgatto @jotsetung

GuangchuangYu commented 7 years ago

an example of using geom_subview, https://github.com/GuangchuangYu/ggimage/issues/3.