code: def barh(d, plt, title=None):
      
      labels = sorted(d, key=d.get)
      index = range(len(labels))
  
      plt.yticks(index, labels)
      plt.barh(index, [d[v] for v in labels])
  
      if title is not None:
          plt.title(title)
docs: A convenience function for plotting a horizontal bar plot from a Counter