散点图
使用颜色对不同密度点进行区分
使用二维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()
)
参考
Last updated
Was this helpful?