title: Labeling horizontal barplot with values in Seaborn
body: <p>I have a horizontal barplot, for example, a simplified version of the <a href="https://seaborn.pydata.org/examples/horizontal_barplot.html" rel="nofollow noreferrer">example from the seaborn documentation</a>:</p>
  <pre><code>import seaborn as sns
  import matplotlib.pyplot as plt
  
  f, ax = plt.subplots(figsize=(6, 15))
  
  crashes = sns.load_dataset(&quot;car_crashes&quot;).sort_values(&quot;total&quot;, ascending=False)
  
  sns.barplot(x=&quot;total&quot;, y=&quot;abbrev&quot;, data=crashes,
              label=&quot;Total&quot;, color=&quot;b&quot;)
  
  ax.set(xlim=(0, 24), ylabel=&quot;&quot;,
         xlabel=&quot;Automobile collisions per billion miles&quot;)
  
  plt.show()
  </code></pre>
  <p>How can I get the bars labeled with the value for each bar?</p>
  <p>I tried this approach for vertical bars (<a href="https://stackoverflow.com/questions/31749448/how-to-add-percentages-on-top-of-bars-in-seaborn">How to add percentages on top of bars in seaborn</a>), but it doesn't seem to work. Changing height to width doesn't have the effect I assumed it would.</p>
  <pre><code>for p in ax.patches:
      height = p.get_width()
      ax.text(p.get_y()+p.get_height()/2.,
              height + 3,
              '{:1.2f}'.format(height),
              ha=&quot;center&quot;)
  </code></pre>
  <p>I'm assuming the horizontal plot works differently?</p>