Filled contour plot with R/ggplot/ggmap

邮差的信 提交于 2019-11-28 10:25:55
jlhoward

It's impossible to test without a more representative dataset (can you provide a link?).

Nevertheless, try:

## not tested..
map = ggmap( baseMap ) + 
    stat_contour( data = flood, geom="polygon", 
                  aes( x = lon, y = lat, z = rain, fill = ..level.. ) ) +
    scale_fill_continuous( name = "Rainfall (inches)", low = "yellow", high = "red" ) 

The problem is that geom_contour doesn't respect fill=.... You need to use stat_contour(...) with geom="polygon" (rather than "line").

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!