title: How to plot the 5 most repeated items in a list?
body: <p>I want  to plot just the 5 most repeated item in my list: </p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  from collections import Counter
  
  result= [162, 152, 47, 116, 34, 199, 69, 34, 51, 109, 89, 244, 30, 51, 151, 21, 88, 75, 75, 25, 221, 30, 75, 180, 21, 75, 41, 21, 30, 21, 183, 41, 117, 78, 88,162]
  print(Counter(result))
  counts= Counter(result)
  common = counts.most_common()
  labels = [item[0] for item in common]
  number = [item[1] for item in common]
  nbars = len(common)
  
  plt.bar(np.arange(nbars), number, tick_label=labels)
  plt.show()
  </code></pre>
  
  <p>My code plots all item, however I want just the 5  most repeated.</p>