stat-density2d

Adding a 3rd Variable to a stat_density_2d Plot

心不动则不痛 提交于 2019-12-24 00:47:21
问题 Below is code and a dataset of a stat_density_2d plot I created in R. library(ggplot2) topKzone <- 3.5 botKzone <- 1.6 inKzone <- -0.95 outKzone <- 0.95 kZone <- data.frame( x=c(inKzone, inKzone, outKzone, outKzone, inKzone), y=c(botKzone, topKzone, topKzone, botKzone, botKzone) ) df$h <- round(df$platelocheight) df$s <- round(df$platelocside) df$es<- round(df$exitspeed) ggplot(kZone, aes(x,y)) + stat_density_2d(data=df, aes(x=s, y=h),geom="polygon") + scale_fill_distiller(palette = "Spectral

stat_density2d - What does the legend mean?

随声附和 提交于 2019-12-10 00:20:18
问题 I have a map done in R with stat_density2d . This is the code: ggplot(data, aes(x=Lon, y=Lat)) + stat_density2d(aes(fill = ..level..), alpha=0.5, geom="polygon",show.legend=FALSE)+ geom_point(colour="red")+ geom_path(data=map.df,aes(x=long, y=lat, group=group), colour="grey50")+ scale_fill_gradientn(colours=rev(brewer.pal(7,"Spectral")))+ xlim(-10,+2.5) + ylim(+47,+60) + coord_fixed(1.7) + theme_void() And it produces this: Great. It works. However I do not know what the legend means. I did

stat_density2d - What does the legend mean?

一曲冷凌霜 提交于 2019-12-04 19:57:29
I have a map done in R with stat_density2d . This is the code: ggplot(data, aes(x=Lon, y=Lat)) + stat_density2d(aes(fill = ..level..), alpha=0.5, geom="polygon",show.legend=FALSE)+ geom_point(colour="red")+ geom_path(data=map.df,aes(x=long, y=lat, group=group), colour="grey50")+ scale_fill_gradientn(colours=rev(brewer.pal(7,"Spectral")))+ xlim(-10,+2.5) + ylim(+47,+60) + coord_fixed(1.7) + theme_void() And it produces this: Great. It works. However I do not know what the legend means. I did find this wikipedia page: https://en.wikipedia.org/wiki/Multivariate_kernel_density_estimation And the