Last active
November 29, 2017 19:53
-
-
Save baptiste/a6dbce4a4a64540752c68bee3660f4aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(grImport2) | |
library(grConvert) | |
library(egg) | |
convertPicture("noun_3663.svg", "balloon.svg") | |
balloon <- readPicture("balloon.svg") | |
d <- data.frame(x=1:9, y=rnorm(9), | |
data = I(Map(function(c, s) list(c=c,s=s),c=blues9,s=1:9)), | |
stringsAsFactors = F) | |
balloonGrob <- function(data,x=0.5,y=0.5){ | |
grob(x=x,y=y,data=data, cl="balloon") | |
} | |
drawDetails.balloon <- function(x, recording=FALSE){ | |
grid.picture(x$x,x$y, picture = balloon, width = unit(x$data$s,"mm"), | |
gpFUN= function(gp)modifyList(gp, list(fill=x$data$c))) | |
} | |
ggplot(d, aes(x,y))+ | |
geom_custom(aes(data = data), grob_fun = balloonGrob) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.