0 Posted 2020-08-13Updated 2024-01-11R / Plot / GGPLOTa minute read (About 120 words)Density plotDensity plot Quick start geom_density_2d library(ggplot2)world <- map_data("world")ggplot(world,aes(long, lat)) +geom_density_2d(color='red') + theme_light() stat_density_2d ggplot(world,aes(long, lat)) + stat_density_2d(aes(fill = stat(level)), geom = "polygon") + theme_map() ggplot(world,aes(long, lat)) + stat_density_2d(aes(fill = stat(level),colour = region), geom = "polygon") + theme_map()+ theme(legend.position = 'none') geom_raster ggplot(faithfuld, aes(waiting, eruptions)) + geom_raster(aes(fill = density))+ theme_map() More Density plothttps://karobben.github.io/2020/08/13/R/Density-plot/AuthorKarobbenPosted on2020-08-13Updated on2024-01-11Licensed under#RStatisticggplot