title: Boxplot dictionaries instead of lists?
body: <p>Let us say I want to create a boxplot of a list which contains the numbers 1-5 about a million times each.</p>
  
  <p>Such a list would be of about size 5 000 000, however represented as a dict it takes no space at all:</p>
  
  <pre><code>s = {1: 1000000, 2: 1000000, 3: 1000000, 4: 1000000, 5:1000000}
  </code></pre>
  
  <p>The problem is, if I try to create a boxplot of that dict I get the error</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;pyshell#17&gt;", line 1, in &lt;module&gt;
      ax.boxplot(s)
    File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/axes.py", line 5462, in boxplot
      if not hasattr(x[0], '__len__'):
  KeyError: 0
  </code></pre>
  
  <p>Is there a clever way of boxplotting the dictionary <code>s</code>, without having to put all the elements in a list?</p>
  
  <hr>
  
  <p>A comment suggested I try </p>
  
  <pre><code>boxplot(n for n, count in s.iteritems() for _ in xrange(count))
  </code></pre>
  
  <p>but this resulted in </p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;pyshell#7&gt;", line 1, in &lt;module&gt;
      boxplot(n for n, count in s.iteritems() for _ in xrange(count))
    File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/pyplot.py", line 2134, in boxplot
      ret = ax.boxplot(x, notch, sym, vert, whis, positions, widths, patch_artist, bootstrap)
    File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/axes.py", line 5462, in boxplot
      if not hasattr(x[0], '__len__'):
  TypeError: 'generator' object has no attribute '__getitem__'
  </code></pre>