I am trying to represent some point data for a region in 3D using the Rayshader package. It plots everything correctly, except that the background is totally black. How to fix this? Below is my code:
base_map <- ggplot(data = df.shp, mapping = aes(x = long, y = lat, group = group)) +
geom_polygon(color = "#8a8a8a", fill = "#8a8a8a") +
coord_quickmap() +
theme_void()
growing_stock = base_map +
geom_point(data = temp1, aes(x=longitude, y=latitude, color=volume_per_ha, group=time),size=2) +
scale_colour_gradient(name = 'Average growing stock [m3/ha]',
limits=range(temp1$volume_per_ha),
low="#FCB9B2", high="#B23A48")
growing_stock
plot_gg(growing_stock, width=5, height=5, multicore = TRUE, scale = 300)
Here is how the plot looks like

You have several options to fix this. Removing
theme_void, or replacing it with one of other themes can change the background color, but will add some otherggplot2components to the graph that you may not want. One easy way to fix the problem is just to explicitly change the background color usingtheme().I changed background color to "white" in this example. You may want to change to another color.