title: How do I make a heatmap-style bivariate histogram in a lattice layout?
body: <p>Take the following example data:</p>
  
  <pre><code>x &lt;- rnorm(10000)
  y &lt;- rnorm(10000) * x
  z &lt;- rnorm(10000) * y
  df &lt;- data.frame(x,y,z)
  </code></pre>
  
  <p>We can produce a scatter plot matrix as follows:</p>
  
  <pre><code>splom(df)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/SMfp5.png" alt="enter image description here"></p>
  
  <p>But due to the large number of overlapping points it is hard to gauge the density.</p>
  
  <p>Is there a straightforwards way to replace each plot with a bivariate histogram heatmap, like those produced by <a href="http://www.cbs.dtu.dk/~eklund/squash/" rel="noreferrer">squash</a>?</p>
  
  <pre><code>library(squash)
  hist2(df$x, df$y)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/DQBtP.png" alt="enter image description here"></p>