I want to add image on 3D plot which is shown on RGL Device. I try add image with annotation_raster() and annotation_custom() but image include be 3D, i expect it be flat. are there code can i use? Thanks..
I try this code but image include 3D, not flat.
image <- magick::image_read("image.png")
image <- rasterGrob(image, interpolate = TRUE,
width=unit(1.5,'cm'),
x = unit(1,"npc"), y = unit(1,"npc"),
hjust = 1, vjust=1)
map <- sf::st_read('map/map.shp', quiet = TRUE)
gg <- ggplot(map) +
geom_sf()+
geom_sf(aes(fill =AREA),linewidth=0.7,colour='black') +
scale_fill_gradient('Area',low='skyblue',high = 'dodgerblue4',na.value = 'white')+
annotation_custom(image)+
theme_bw()+
theme(axis.line = element_blank(),axis.title = element_blank(),
axis.ticks = element_blank(), axis.text = element_blank()
)
plot_gg(gg, height = 8.5, width = 9,
multicore = TRUE,windowsize = c(1050, 600),
offset_edges = TRUE)