title: Using dictionary to make a matplotlib graph?
body: <p>If I had a dictionary of words and their frequency in a string, for example:</p>
  
  <pre><code>{'hello': 3, 'how': 4, 'yes': 10, 'you': 11, 'days': 10, 'are': 20, 'ago': 11}
  </code></pre>
  
  <p>How could I make a bar graph out of this using matplotlib? I found a previous question which had a seemingly good solution, but it didn't work for me (<a href="https://stackoverflow.com/questions/16010869/python-plot-a-bar-using-matplotlib-using-a-dictionary">python: plot a bar using matplotlib using a dictionary</a>)</p>
  
  <p>When I run </p>
  
  <pre><code>plt.bar(range(len(d)), d.values(), align="center")
  plt.xticks(range(len(d)), d.keys())
  </code></pre>
  
  <p>I get the error</p>
  
  <pre><code>TypeError: 'dict_keys' object does not support indexing
  </code></pre>
  
  <p>I don't really see where I'm indexing my dictionary. It might be because in the question from which I got the code the x-values were also numbers? I'm not sure.</p>