if (FALSE) {
# Put a silhouette behind a plot based on a taxonomic name
library(ggplot2)
ggplot(iris) +
add_phylopic(x = 6.1, y = 3.2, name = "Iris", alpha = 0.2) +
geom_point(aes(x = Sepal.Length, y = Sepal.Width))
# Put a silhouette in several places based on UUID
posx <- runif(10, 0, 10)
posy <- runif(10, 0, 10)
heights <- runif(10, 0.4, 2)
angle <- runif(10, 0, 360)
hor <- sample(c(TRUE, FALSE), 10, TRUE)
ver <- sample(c(TRUE, FALSE), 10, TRUE)
fills <- sample(c("black", "darkorange", "grey42", "white"), 10,
replace = TRUE)
alpha <- runif(10, 0.3, 1)
p <- ggplot(data.frame(cat.x = posx, cat.y = posy), aes(cat.x, cat.y)) +
geom_blank() +
add_phylopic(uuid = "23cd6aa4-9587-4a2e-8e26-de42885004c9",
x = posx, y = posy, height = heights,
fill = fills, alpha = alpha, angle = angle,
horizontal = hor, vertical = ver)
p + ggtitle("R Cat Herd!!")
}
Run the code above in your browser using DataLab