title: Share axis and remove unused in matplotlib subplots
body: <p>I want to plot a series of seaborn heatmaps in a grid. I know the number of subplots (which can be odd or even).
  The heatmaps will show the mean "occupation ratio" by "day of week" (y axis) and "hour of day" (x axis), e.g. they all share the same x / y domains.</p>
  
  <p>Here's my current code:</p>
  
  <pre><code>df2 = df[['name','openLots','occupationRatio','DoW','Hour']]
  fig, axs = plt.subplots(figsize=(24,24), nrows=7, ncols=6)
  axs = axs.flatten()
  locations = df2['name'].sort_values().unique()
  
  
  def occupation_heatmap (name, ax):
      dfn = df2[df2['name'] == name]
      dfn = dfn.groupby(['DoW', 'Hour']).mean()['occupationRatio'].unstack()
      dfn = dfn.reindex(['Mon', 'Tue', 'Wed','Thu','Fri','Sat','Sun'])
      sns.heatmap(data=dfn, cmap="coolwarm", vmin=0, vmax=1.0, ax= ax)
      ax.set_title(name)
  
  
  i = 0
  for n in locations: 
      occupation_heatmap (n, axs[i])
      i = i+1
  
  plt.tight_layout()
  </code></pre>
  
  <p>It looks <em>almost</em> like what I want (last few rows):
  <a href="https://i.stack.imgur.com/m5g7k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m5g7k.png" alt="note axis labels, legend and &quot;empty&quot; subplots"></a>
  However want I want:</p>
  
  <ul>
  <li>Have the y axis labels (DoW) only once per row (leftmost plot)</li>
  <li>Have the colormap legend only on the rightmost plot in each row (or leave it out completely, the colors are pretty self-explainatory)</li>
  <li>remove the "empty plots" in the last row because of an odd total number</li>
  </ul>
  
  <p>Many thanks for any hints </p>