title: Pairwise graphical comparison of several distributions
body: <p>This is an edited version of a previous question.</p>
  <p>We are given an <em>m</em> by <em>n</em> table of <em>n</em> observations (samples) over <em>m</em> variables (genes, etc), and we are looking to study behavior of the variables between each pair of observations - For instance the two observations having the highest positive or negative correlation. For this purpose I have seen a great chart in Stadler et.al. Nature paper (2011):</p>
  <p><img src="https://i.stack.imgur.com/YNz6J.png" alt="enter image description here" /></p>
  <p>Here it could be a sample dataset to be used.</p>
  <pre><code>m &lt;- 1000
  samples &lt;- data.frame(unif1 = runif(m), unif2 = runif(m, 1, 2), norm1 = rnorm(m), 
                        norm2 = rnorm(m, 1), norm3 = rnorm(m, 0, 5))
  </code></pre>
  <p>I have already tested <code>gpairs(samples)</code> of package <code>gpairs</code> that produces this one. It's a good start, but has no option to put correlation coefficients on the upper-right section, nor the density plots on the lower corner:</p>
  <p><img src="https://i.stack.imgur.com/KZytp.png" alt="enter image description here" /></p>
  <p>Next I used <code>ggpairs(samples, lower=list(continuous=&quot;density&quot;))</code> of package <code>GGally</code> (Thanks @LucianoSelzer for a comment below). Now we have correlations on the upper corner and the densities on the lower corner, but we are missing the diagonal barplots, and the density plots are not heatmap shaped.</p>
  <p><img src="https://i.stack.imgur.com/ssV7n.png" alt="enter image description here" /></p>
  <p>Any ideas to make the more closer to the desired picture (the first one)?</p>