title: Plotting categorical data into a single bar plot of relative frequency with python/pandas/seaborn
body: <p>I have a bunch of categorical data from a survey and I would like to plot it in the same way as shown <a href="http://i.stack.imgur.com/pGidY.png" rel="nofollow">here</a>. Effectively it is a bar shaped pie chart.</p>
  
  <p>The data is in a pandas data frame, and here is a toy example of what I've tried to do:</p>
  
  <pre><code>import pandas as pd
  import seaborn as sns
  import matplotlib.pyplot as plt
  
  
  # create toy dataframe
  df = pd.DataFrame({'Names': ['Steve','Steve','Steve','Jon','Michael','Michael','Eric'] })
  
  
  # get pd.Series of counts of each name
  data_counts = df['Names'].value_counts()
  
  
  # return the name of each category, and its counts separately
  category_names = data_counts.index
  category_counts = data_counts.get_values()
  
  
  # attempt to plot
  f, ax = plt.subplots(figsize=(10, 10))
  colors = ['red', 'green', 'blue', 'yellow']
  i=0
  for name, data in zip(category_names, category_counts):
  
      sns.barplot(x=data, label=name, color=colors[i])
      i+=1
  
  handles, labels = ax.get_legend_handles_labels()
  ax.legend(loc='upper right', prop={'size':12})
  </code></pre>
  
  <p>This produces a kind of stacked histogram, but each category is not proportionally represented. Each bar is over-plotted rather than plotted as a fractional share.</p>
  
  <p>Is this along the right lines?</p>