title: Horizontal barplot with annotations
body: <p>I was successfully running the code when apparently python kernel died and dies everytime I am running this code:
  Is it something wrong with the code or the problem is deeper? I can run other notebooks without problems.</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  import matplotlib.pyplot as plt
  import seaborn as sns
  %matplotlib inline
  plt.rcParams['text.usetex'] = False
  
  
  
  df = pd.DataFrame(np.random.uniform(size=37)*100, columns=['A'])
  
  ax = plt.figure(figsize=(10,5))
  
  plt.barh(df.index, df['A'], color='ForestGreen')
  plt.yticks(df.index)
  
  
  def annotateBars(row, ax=ax):
      if row['A'] &lt; 20:
          color = 'black'
          horalign = 'right'
          horpad = 2
      else:
          color = 'white'
          horalign = 'right'
          horpad = -2
  
      ax.text(row.name, row['A'] + horpad, "{:.1f}%".format(row['A']),
           color=color,
              horizontalalignment=horalign,
              verticalalignment='center',
              fontsize=10)
  
  junk = df.apply(annotateBars, ax=ax, axis=1)
  </code></pre>