
geom layer for visualizing image files
geom_image(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
inherit.aes = TRUE,
na.rm = FALSE,
by = "width",
nudge_x = 0,
...
)
geom layer
aes mapping
data
stat
position
logical, whether inherit aes from ggplot()
logical, whether remove NA values
one of 'width' or 'height'
horizontal adjustment to nudge image
additional parameters
Guangchuang Yu
if (FALSE) {
library("ggplot2")
library("ggimage")
set.seed(2017-02-21)
d <- data.frame(x = rnorm(10),
y = rnorm(10),
image = sample(c("https://www.r-project.org/logo/Rlogo.png",
"https://jeroenooms.github.io/images/frink.png"),
size=10, replace = TRUE)
)
ggplot(d, aes(x, y)) + geom_image(aes(image=image))
}
Run the code above in your browser using DataLab