biocore/scikit-bio — pull request #700 by jairideout (2014-10-06 23:33:54+00:00)
Title: Support newest matplotlib release

The newest matplotlib release (1.4.0) had its boxplot functionality largely rewritten/refactored. There were a few unintended API/behavior changes that affect the boxplotting functionality in skbio (`skbio.draw.boxplots`). The most noticeable change is that a `ValueError` is raised if an empty distribution is provided; in the past, this type of input was supported.

This bug has been fixed in the latest development version of matplotlib (https://github.com/matplotlib/matplotlib/pull/3571). It was first noticed in pandas (https://github.com/pydata/pandas/issues/8382) and they worked around this issue by passing `np.array([np.nan])` instead of an empty sequence (https://github.com/pydata/pandas/pull/8240). We use their approach here in order support plotting empty distributions in pre- and post-1.4.0 matplotlib releases. If we decide to only support matplotlib > 1.4.0 at some point in the future, this NaN hack can be removed.

Some of the existing boxplot test code had to be updated to work in either matplotlib version; this was due to changes in the fliers returned by `pyplot.boxplot` (https://github.com/matplotlib/matplotlib/issues/3544). I also added (very ugly) test code to test that the NaN hack appears to be working; this will hopefully catch changes to matplotlib's boxplot functionality in the future if the hack stops working as intended.

I updated Travis to test against matplotlib < 1.4.0 and whatever the latest release is, in order to make sure that our code works with either version.

Fixes #649.