library(plotly) g1 <- plot_ly(z = ~volcano, type = "surface") g2 <- plot_ly(z = ~volcano, type = "heatmap")