in this post the question was answered how to plot a density plot in ggplot highlighting the hdi using the package ggridges. I have following related question to this method