Perhaps you can use a spline fit to generate predicted densities at arbitrary x values as in the following code.
library(ggplot2)
set.seed(1)
x <- rnorm(100, 2, 0.5)
DensX <- density(x)
DensFunc <- splinefun(DensX$x, DensX$y)
FitValues <- data.frame(NewX = seq(1,3,0.1), NewY = DensFunc(seq(1,3,0.1)))
ggplot() + geom_histogram(mapping = aes(x = x, y = ..density..), color = "white") +
geom_point(mapping = aes(x = NewX, y = NewY),data = FitValues, size = 3) +
geom_density(mapping = aes(x = x), color = "red", size = 1)
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Created on 2020-03-10 by the reprex package (v0.3.0)