I'm trying to use a non squared image in a {ggimage}
layer but I can't seem to make the ratio fit the orignal image ratio. Documentation points to the asp
argument but this doesn't seem to work.
Here's an obviously non square image : https://ps.w.org/insert-headers-and-footers/assets/banner-772x250.png
Here is the result from {ggimage}
:
library(ggimage)
library(ggplot2)
d <- data.frame(
x = 1,
y = 1,
image = "https://ps.w.org/insert-headers-and-footers/assets/banner-772x250.png"
)
ggplot(d, aes(x, y)) +
geom_image(aes(image=image), size = 1)
ggplot(d, aes(x, y)) +
geom_image(aes(image=image), size = 1, asp = 0.1)
ggplot(d, aes(x, y)) +
geom_image(aes(image=image), size = 1, asp = 0.5)
ggplot(d, aes(x, y)) +
geom_image(aes(image=image), size = 1, asp = 0.9)
How can I make the image keep the original width/height ratio?