I am trying to turn a ggplot into a 3D plot using the rayshader package.
The ggplot is made with geom_raster()
and works fine. This is how it looks like:
Here is the code for the 2D plot. Although, I think that's not where the core of the problem is. Because as already mentioned, it works until here.
Plot = Score_image %>%
ggplot(aes(x=as.numeric(x),
y=as.numeric(y), fill= PC_1)) +
geom_raster()+
theme_void()+
scale_fill_viridis(na.value = "white")
Then I try to turn it into a 3D plot with plot_gg(Plot)
and I receive the following error code:
Error in png::readPNG(paste0(heightmaptemp, ".png")) :
unable to open C:\Users\...\AppData\Local\Temp\RtmpGQuKkm\file16dc6dd3339f.png
I have no idea what the error means and I didn't find anything online. I tried re-installing rayshader, but that didn't help. plot_gg
works with also with other grahps that I have tried.
Does anyone know what the problem is?