Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/users/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ Andrew Dawson added the ability to add axes titles flush with the left and
right sides of the top of the axes using a new keyword argument `loc` to
:func:`~matplotlib.pyplot.title`.

More robust boxplots
--------------------
Paul Hobson provided a fix to the :func:`~matplotlib.pyplot.boxplot`
method that prevent whiskers from being drawn inside the box for
oddly distributed data sets.

.. _whats-new-1-2:

new in matplotlib-1.2
Expand Down
6 changes: 4 additions & 2 deletions lib/matplotlib/axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6024,17 +6024,19 @@ def computeConfInterval(data, med, iq, bootstrap):
iq = q3 - q1
hi_val = q3 + whis * iq
wisk_hi = np.compress(d <= hi_val, d)
if len(wisk_hi) == 0:
if len(wisk_hi) == 0 or np.max(wisk_hi) < q3:
wisk_hi = q3
else:
wisk_hi = max(wisk_hi)

# get low extreme
lo_val = q1 - whis * iq
wisk_lo = np.compress(d >= lo_val, d)
if len(wisk_lo) == 0:
if len(wisk_lo) == 0 or np.min(wisk_lo) > q1:
wisk_lo = q1
else:
wisk_lo = min(wisk_lo)

# get fliers - if we are showing them
flier_hi = []
flier_lo = []
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading