I'm trying to use cowplot package's draw_image()
function. I've managed to get an image in a graph as an example.
I can't work out how the xy locations work, I had to keep inputting random numbers until I got to see the image.
require(ggplot2) #required packages
require(cowplot)
require(magick)
p1 <- qplot(Sepal.Length, Sepal.Width, data = iris)
ggdraw(p1) +
draw_image(
"https://upload.wikimedia.org/wikipedia/en/7/77/EricCartman.png",
y = 0.2,
scale = 0.5
)
Can anyone advise on what scale they function? It sure doesn't seem to be the same scale as the graph.