title: How to change Seaborn Data Labels to show two decimal places
body: <p>How do I code data labels in a seaborn barplot (or any plot for that matter) to show two decimal places?</p>
  
  <p>I learned how to show data labels from this post:
  <a href="https://stackoverflow.com/questions/39444665/add-data-labels-to-seaborn-factor-plot">Add data labels to Seaborn factor plot</a></p>
  
  <p>But I can't get the labels to show digits.  </p>
  
  <p>See example code below:</p>
  
  <pre><code>#make the simple dataframe
  married = ['M', "NO DATA", 'S']
  percentage = [68.7564554, 9.35558, 21.8879646]
  df = pd.DataFrame(married, percentage)
  df.reset_index(level=0, inplace=True)
  df.columns = ['percentage', 'married']
  
  #make the bar plot
  sns.barplot(x = 'married', y = 'percentage', data = df)
  plt.title('title')
  plt.xlabel('married')
  plt.ylabel('Percentage')
  
  #place the labels
  ax = plt.gca()
  y_max = df['percentage'].value_counts().max() 
  ax.set_ylim(1)
  for p in ax.patches:
      ax.text(p.get_x() + p.get_width()/2., p.get_height(), '%d' % 
      int(p.get_height()), 
          fontsize=12, color='red', ha='center', va='bottom')
  </code></pre>
  
  <p>Thank you for any help you can provide</p>