我创建了一个代码来制作散点图和密度图。对于几个样本,我已将边界设置为某个值。散点图 (geom_point) 不在边界的左侧绘制,而密度图 (stat_density2d) 确实绘制在边界的左侧。如何覆盖或删除绘图的该部分(即边界左侧的阴影/alpha,在 x 轴上的 1x10E1 和 1x10E2 之间)?
非常感谢!
visual <- ggplot(data=samples, aes(GRNHLin, REDHLin)) + geom_point(colour='dodgerblue3', size=0.375) +
stat_density_2d(aes(alpha = ..density..), geom = 'tile', contour = FALSE) +
scale_x_log10(breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)), limits = c(1,1e4)) +
scale_y_log10(breaks = trans_breaks("log10", function(x) 10^x),
labels = trans_format("log10", math_format(10^.x)), limits = c(1,1e3)) +
geom_vline(xintercept=40) +
labs(x="Green Fluorescence", y="Red Fluorescence")
visual