I want to make 3D map with rayshader. I have seen this web https://www.tylermw.com/3d-ggplots-with-rayshader/ and try the code with my data. In this web, height map has black color but not on my output. Are there any way to get result like that? Thanks..
I use this code.
map <- sf::st_read('map/map.shp', quiet = TRUE)
gg = ggplot(map) +
geom_sf(aes(fill =AREA),linewidth=0.7,colour='black',inherit.aes=FALSE) +
scale_fill_viridis('Area',na.value = 'white')+
theme(axis.line = element_blank(),axis.title = element_blank(),
axis.ticks = element_blank(), axis.text = element_blank())
plot_gg(gg, multicore = TRUE, width = 6 ,height=2.7, fov = 70,offset_edges = TRUE)



Obviously, you are using new version of
ggplot23.4.0. I think your issue is not about adding color but more likely to do with newer version ofggplot2, specifically newlinewidth(). Your color is still correct as black but thinner. This has been documented https://ggplot2.tidyverse.org/news/index.html.I have also experienced some strange behaviors with
ggplot23.4.0 andrayshader. As you can see in the following graph, my 3D graph withggplot23.4.0 became unrecognizable.rayshader with ggplot 3.4.0
The only solution I have so far is to switch back to
ggplot23.3.6.You may want to try it, as least as a temporary solution.
rayshader with ggplot 3.3.6