title: Create a 2x2 grid of python seaborn heatmaps with shared axes
body: <p>I am looking to create a 2 x 2 grid of seaborn heatmaps from a pandas dataframe in python, but I am having trouble getting the desired result. Currently, this code...</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  import seaborn as sns
  
  df = pd.DataFrame({'x': np.random.uniform(0, 100, 1000), 
                     'y': np.random.uniform(0, 100, 1000), 
                     'z1': np.random.uniform(0, 1, 1000),
                     'z2': np.random.uniform(0, 1, 1000),
                     'z3': np.random.uniform(0, 1, 1000),
                     'z4': np.random.uniform(0, 1, 1000)})
  
  fig,axn = plt.subplots(2, 2, sharex=True, sharey=True)
  result0 = df.pivot(index='x', columns='y', values='z1')
  result1 = df.pivot(index='x', columns='y', values='z2')
  result2 = df.pivot(index='x', columns='y', values='z3')
  result3 = df.pivot(index='x', columns='y', values='z4')
  
  plt.subplot(2, 2, 1)
  sns.heatmap(result0, annot=False, cmap='RdBu_r')
  plt.subplot(2, 2, 2)
  sns.heatmap(result1, annot=False, cmap='RdBu_r')
  plt.subplot(2, 2, 3)
  sns.heatmap(result2, annot=False, cmap='RdBu_r')        
  plt.subplot(2, 2, 4)
  sns.heatmap(result3, annot=False, cmap='RdBu_r') 
  </code></pre>
  
  <p>generates a graph that looks like this...
  <a href="https://i.stack.imgur.com/3f2Vu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3f2Vu.png" alt="enter image description here"></a></p>
  
  <p>But the features I want to add are:</p>
  
  <ul>
  <li>Invert each of the y-axes, so that 0 is at the bottom and 100 at the top</li>
  <li>The grid should share both x and y axes, so that the ticks are not displayed unnecessarily</li>
  <li>The y-axis and x-axis ticks should be whole numbers, not decimals (despite the y series being floats</li>
  <li>Each grid should have a separate title</li>
  <li>The colour bar should be shared across all charts</li>
  </ul>
  
  <p>That sample data doesn't really do the heatmap justice, but I couldn't figure out a better way atm. Any help solving five points above would be greatly appreciated. Thanks!</p>