title: How to plot groupby as percentage in seaborn?
body: <p>I have a binary classification problem, which I want to solve with a RandomForestClassifier. My target column is 'successful' which is either 0 or 1. I want to investigate the data, and see how it looks like. For that I tried to do count plots by category. But it's not saying how much in percentage from total are 'successful' (i.e. successful == 1)</p>
  
  <p>How can I change the following plot, so that these subplots display the percentage of (successful == 1) of total of all posts? (Let's say in category weekday, in day 'Saturday' I have 10 datapoints, 7 of them are successful ('successful' == 1), so I want to have a bar with points at that day at 0.7. </p>
  
  <p>Here is the actual plot (counts :-/): </p>
  
  <p><a href="https://i.stack.imgur.com/3WztN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3WztN.png" alt="actual count plot"></a></p>
  
  <p>And here is a part of my dataframe:</p>
  
  <p><a href="https://i.stack.imgur.com/YrpDd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YrpDd.png" alt="15 samples of my df"></a></p>
  
  <p>And here is the actual code used to generate the actual plot:</p>
  
  <pre><code># Plot 
  
  sns.set(style="darkgrid")
  
  x_vals = [['page_name', 'weekday'],['type', 'industry']]
  subtitles = [['by Page', 'by Weekday'],['by Content Type', 'by Industry']]
  
  fig, ax = plt.subplots(2,2, figsize=(15,10))
  #jitter = [[False, 1], [0.5, 0.2]]
  
  for j in range(len(ax)):
      for i in range(len(ax[j])):
          ax[j][i].tick_params(labelsize=15)
          ax[j][i].set_xlabel('label', fontsize=17, position=(.5,20))
          if (j == 0) :
              ax[j][i].tick_params(axis="x", rotation=50) 
          ax[j][i].set_ylabel('label', fontsize=17)
          ax[j][i] = sns.countplot(x=x_vals[j][i], hue="successful", data=mainDf, ax=ax[j][i])
  
  for j in range(len(ax)):
      for i in range(len(ax[j])):
          ax[j][i].set_xlabel('', fontsize=17)
          ax[j][i].set_ylabel('count', fontsize=17)
          ax[j][i].set_title(subtitles[j][i], fontsize=18)
  
  fig.suptitle('Success Count by Category', position=(.5,1.05), fontsize=20)
  
  fig.tight_layout()
  fig.show()
  </code></pre>
  
  <p>PS: Please not, I am using Seaborn. Solution should be also with Seaborn, if possible. Thanks! </p>