I was wondering whether it is possible to add shapes to the legend for ggimage()
. I found similar questions, but they either have 1) same picture with a different color in legend, or 2) same picture different colors. I used this link to add images to the legend that have color, but i can't figure out how to edit it so that image will be different. I tried this, but I am not advance enough to adjust the code to fit my case
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, color=image), size=.05)