I am currently trying to create a plot that has logos mapping to X and Y coordinates. The goal though is have another set of points with the same logos, but with an alpha value so that the logos are more transparent.
Here is a reproducible example. The goal is to have the logos on the left be transparent.
library(ggimage)
library(tidyverse)
library(RCurl)
Sample_X1 <- c(1,0,2,3,1)
Sample_X2 <- c(4,5,7,4,3)
Sample_Y <- c('A','B','C','D','E')
Logo <- 'https://i1.pngguru.com/preview/233/348/954/numix-circle-for-windows-rstudio-icon-png-icon-thumbnail.jpg'
data <- data.frame(cbind(Sample_X1, Sample_X2, Sample_Y, Logo))
ggplot(data = data) +
geom_segment(aes(x = Sample_X1, xend = Sample_X2, y = Sample_Y, yend = Sample_Y), size = 1) +
geom_image(aes(x = Sample_X1, y = Sample_Y, image = Logo), size = .05) +
geom_image(aes(x = Sample_X2, y = Sample_Y, image = Logo), size = .05) +
theme_minimal() +
labs(title = 'Example for Stack Overflow')
Is there a way to accomplish this with ggplot? So far I have only been able to find ways to make background logos transparent, but they aren't able to be mapped to the XY data.
Any help is appreciated!