title: Bar plot with groupby
body: <p>My categorical variable <code>case_satus</code> takes on four unique values. I have data from 2014 to 2016. I would like to plot the distribution of <code>case_status</code> grouped by year. I try to this using:</p>
  
  <pre><code>df.groupby('year').case_status.value_counts().plot.barh()
  </code></pre>
  
  <p>And I get the following plot:</p>
  
  <p><a href="https://i.stack.imgur.com/g9N44.png" rel="noreferrer"><img src="https://i.stack.imgur.com/g9N44.png" alt="output"></a></p>
  
  <p>What I would like to have is a nicer represenation. For example where I have one color for each year, and all the "DENIED" would stand next to each other.</p>
  
  <p>I think it can be achieved since the groupby object is a multi-index, but I don't understand it well enough to create the plot I want. </p>
  
  <hr>
  
  <p>The solution is: </p>
  
  <pre><code>df.groupby('year').case_status.value_counts().unstack(0).plot.barh()
  </code></pre>
  
  <p>and results in </p>
  
  <p><a href="https://i.stack.imgur.com/ibcu3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ibcu3.png" alt="enter image description here"></a></p>