R plot filled.contour() output in ggpplot2

前端 未结 3 1724
南旧
南旧 2020-12-15 00:45

I want to plot this figure created with filled.contour(), but in ggplot2, how do I do this?

I want to use ggplot2 because the graphing conventions are easier. The r

3条回答
  •  无人及你
    2020-12-15 01:21

    I took the example from the ggplot2 website.

     # Generate data
     library(reshape2) # for melt
     volcano3d <- melt(volcano)
     names(volcano3d) <- c("x", "y", "z")
    
     # Basic plot
     v <- ggplot(volcano3d, aes(x, y, z = z)) +  
         stat_contour(geom="polygon", aes(fill=..level..))
    

    Where x and y are your Long and Lat and z is d13C

提交回复
热议问题