title: Moving x-axis to the top of a plot in matplotlib
body: <p>Based on <a href="https://stackoverflow.com/questions/14391959/heatmap-in-matplotlib-with-pcolor">this question about heatmaps in matplotlib</a>, I wanted to move the x-axis titles to the top of the plot.</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  column_labels = list('ABCD')
  row_labels = list('WXYZ')
  data = np.random.rand(4,4)
  fig, ax = plt.subplots()
  heatmap = ax.pcolor(data, cmap=plt.cm.Blues)
  
  # put the major ticks at the middle of each cell
  ax.set_xticks(np.arange(data.shape[0])+0.5, minor=False)
  ax.set_yticks(np.arange(data.shape[1])+0.5, minor=False)
  
  # want a more natural, table-like display
  ax.invert_yaxis()
  ax.xaxis.set_label_position('top') # &lt;-- This doesn't work!
  
  ax.set_xticklabels(row_labels, minor=False)
  ax.set_yticklabels(column_labels, minor=False)
  plt.show()
  </code></pre>
  
  <p>However, calling <a href="http://matplotlib.org/api/axis_api.html#matplotlib.axis.XAxis.set_label_position" rel="noreferrer">matplotlib's set_label_position</a> (as notated above) doesn't seem to have the desired effect. Here's my output:</p>
  
  <p><img src="https://i.stack.imgur.com/rdgE5.png" alt="enter image description here"></p>
  
  <p>What am I doing wrong?</p>