Displaying a kernel density estimate

If you have a lot “spikey” histograms, a kernel density estimate to smooth it out is really nice. When I’m using matplotlib I just add kde=True and it’s done. As far as I can tell, there’s no simple way of creating this on any visual in Quicksight. (I would be so happy if this could get on a roadmap somewhere…)

My options at the moment:

  • I can create a KDE in python with matplotlib, store the result in s3 and use a URL viewer. Downside: can’t do any filtering this way, unless I pre-compute a graph for every slice I’ll every plan to use. (And even then, how would I get the right image displayed in quicksight?)

  • I can create a view in postgresql. I tried doing this initially, but the SQL to create a kernel density estimate is pretty hideous and doesn’t compute very quickly.

Any other ideas or suggestions of how I can make it happen?

They added this feature for line charts.

Is this something you are looking for?

That looks line interpolation using (? splines ?), which makes sense if you have continuous x and continuous y. i.e. you have a line chart and you want to make it smoother.

A kernel density estimate smooths out a histogram.