title: Matplotlib put x ticks above bar
body: <p>Is there any way to put the x-ticks above each stacked bar in a stacked bar chart, rather than below the x-axis? To be clear, I don't mean place the x-tick above each individual bar in a single stacked bar, I mean place the x-tick above the stacked bar itself. Here's how I'm creating my plot:</p>
  
  <pre><code>df = pd.DataFrame(np.random.randint(1, 5, size=(3200, 3)))    
  df.loc[np.random.choice(df.index, size=3190, replace=False), :] = 0
  
  df_select = df[df.sum(axis=1)&gt;1]
  fig, ax = plt.subplots()
  
  ax.bar(df_select.index, df_select.iloc[:,0], label = df_select.columns[0], wdith = 15)
  
  if df_select.shape[1] &gt; 1:
      for i in range(1, df_select.shape[1]):
          bottom = df_select.iloc[:,np.arange(0,i,1)].sum(axis=1)
          ax.bar(df_select.index, df_select.iloc[:,i], bottom=bottom, label = 
  df_select.columns[i], width = 15)
  
  ax.set_xticks(df_select.index)
  plt.legend(loc='best', bbox_to_anchor=(1, 0.5))
  plt.xticks(rotation=90, fontsize=8) #this puts the x ticks below the x axis
  </code></pre>
  
  <p>Additionally, I'd like to place some text at specific points along the x axis. I'm storing these sites in a list:</p>
  
  <pre><code>sites = [19, 173, 1002] # the number and elements of this list vary
  </code></pre>
  
  <p>So, for example, at x = 173, I'd like to place the text 'site (173)' along with a tick at position 173. </p>
  
  <p>For your reference, I've posted images for what my current code produces, and what I would like to produce:
  current: <a href="https://i.stack.imgur.com/QDlEP.png" rel="nofollow noreferrer">https://i.stack.imgur.com/QDlEP.png</a>
  goal: <a href="https://i.stack.imgur.com/IJJo4.png" rel="nofollow noreferrer">https://i.stack.imgur.com/IJJo4.png</a></p>