title: Explicitly set the whisker lengths of a box in boxplot
body: <p>I would like to draw a <code>boxplot</code> figure using <code>matplotlib</code>.</p>
  
  <p>This is my current figure:
  <a href="https://i.stack.imgur.com/GOcg2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GOcg2.png" alt="enter image description here"></a></p>
  
  <p>And this is the code to generate the figure:</p>
  
  <pre><code>pt = plt.boxplot(all_data, sym='+')
  plt.yticks([0, 0.2, 0.4, 0.6, 0.8, 1.0], ['0', '20%', '40%', '60%', '80%', '100%'])
  plt.xticks([y + 1 for y in range(len(all_data))], ['WMC', 'DIT', 'CBO', 'RFC', 'LCOM', 'Ca', 'NPM'])
  mean = []
  
  for line in pt['medians']:
      x, y = line.get_xydata()[1] # top of median line
      plt.text(x, y, '%.1f' % x,
        horizontalalignment='center') # draw above, centered
  
  plt.savefig("boxplot1.pdf")
  </code></pre>
  
  <p>A box in a boxplot shows the 1st, 2nd and 3rd quartiles (Q1, the median and Q3) of a dataset. For each box, there is a line (which is also called a whisker and whose length is 1.5*IQR (inter quartile range) by default). So basically what I am looking for is instead of using the default value, explicitly <strong>set</strong> the lower and upper limits (or the whisker length) to a certain value I specify.</p>
  
  <p>Could anyone shed some lights on this?</p>