使用二维bin统计对点进行划分,将bin的数目通过颜色进行映射。
ggplot(data, aes(y = 1 - V2, x = V3)) + stat_bin_2d(binwidth = c(0.01, 0.01)) + scale_fill_gradient2(mid = "gray", high = "red") + ylim(c(0, 2)) + xlim(c(0, 2)) + theme_bw() + theme( axis.text = element_blank(), axis.title = element_blank() )
https://zhuanlan.zhihu.com/p/30706049
Last updated 4 years ago