From http://blog.mckuhn.de/2013/04/2d-plot-with-histograms-for-each.html