title: How do I plot my histogram for density rather than count? (Matplotlib)
body: <p>I have a data frame called 'train' with a column 'string' and a column 'string length' and a column 'rank' which has ranking ranging from 0-4. </p>
  
  <p>I want to create a histogram of the string length for each ranking and plot all of the histograms on one graph to compare. I am experiencing two issues with this: </p>
  
  <p>The only way I can manage to do this is by creating separate datasets e.g. with the following type of code:</p>
  
  <pre><code>S0 = train.loc[train['rank'] == 0]
  S1 = train.loc[train['rank'] == 1]
  </code></pre>
  
  <p>Then I create individual histograms for each dataset using: </p>
  
  <pre><code>plt.hist(train['string length'], bins = 100)
  plt.show()
  </code></pre>
  
  <p>This code doesn't plot the density but instead plots the counts. How do I alter my code such that it plots density instead? </p>
  
  <p>Is there also a way to do this without having to create separate datasets? I was told that my method is 'unpythonic'</p>