Я не знаю, какова ваша плотность, но вот пример "обычной" плотности.
library(data.table)
# simulated data
n <- 1000
DT <- data.table(Chr = rep(c("Chr1","Chr2"),each=n),
v = c(rgamma(n, 2, 3), rgamma(n,10,3)))
# construct density data
DT2 <- DT[, {dty <- density(v, from = 0, to = max(v))
list(x=dty$x,
z=cut(dty$y, c(seq(0,1,by=0.1), Inf)))},
by="Chr"]
library(ggplot2)
ggplot(DT2, aes("",round(x,1))) + geom_tile(aes(fill=z)) +
facet_grid(~Chr) + xlab(NULL) + ylab("something") +
scale_fill_viridis_d("density")
# I take round(x,1) because that does not work with x (looks like a bug)