Skip to content
Prev 385708 / 398503 Next

Mapping 2D to 3D

H
On 09/19/2020 04:33 PM, Abby Spurdle wrote:
I was looking at this example which uses geom_contour():

ggvolcano = volcano %>%
?reshape2::melt() %>%
?ggplot() +
?geom_tile(aes(x=Var1,y=Var2,fill=value)) +
?geom_contour(aes(x=Var1,y=Var2,z=value),color="black") +
?scale_x_continuous("X",expand = c(0,0)) +
?scale_y_continuous("Y",expand = c(0,0)) +
?scale_fill_gradientn("Z",colours = terrain.colors(10)) +
?coord_fixed()
print(ggvolcano)