rve if called with a new bandwidth.
function plot_kde(container, data, bandwidth, xscale, yscale, x) {
    const n = x.length;
    const kde = kernelDensityEstimation(data, bandwidth);
    const density = new Array(n);

    for (let i=0; i<n;i++){
	let tmp = x[i] ;
	density[i] = [tmp, kde(tmp)];
    }

    const graph = container
	  .append('g')
	  .append("path")
	  .attr("class", "mypath")
	  .datum(density)
	  .attr("fill", "#4ECDC4")
	  .attr("opacity", ".8")
	  .attr("stroke", "#292F36")
	  .attr("stro