Is there a way to insert an image into a graph in R and set its color when I do this? I would like to insert a silhouette for a given dataset and set it according to the color that I have chosen to build the corresponding data points. I donβt have a clear understanding of how graphics are managed - in computer systems in general and in R - which can provide an answer to this question.
The code below inserts an image, but I canβt determine how the color changes.
require(jpeg) thiscolor <- "red" plot(x=c(1, 4), y=c(1, 2), main="test plot", col=thiscolor) thispic <- readJPEG(<insert path for any image here>) rasterImage(thispic, xleft=3, xright=3.5, ytop=2, ybottom=1.8, )
source share