histogram_with_kernel = function(x, s0, s1, bwh, bwd, title, ...) {
breaks = seq(s0, s1, bwh)
out = hist(x, breaks=breaks, main=title, ...)
k = density(x, bw=bwd)
k$y = k$y * (k$n) * bwh
lines(k, lwd=2)
return(out)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.