|  | 
| 11 | 11 | from nose.tools import assert_equal | 
| 12 | 12 | import numpy as np | 
| 13 | 13 | from numpy.testing import assert_array_equal, assert_array_almost_equal | 
|  | 14 | +from nose.plugins.skip import SkipTest | 
| 14 | 15 | 
 | 
| 15 | 16 | import matplotlib.pyplot as plt | 
| 16 | 17 | import matplotlib.collections as mcollections | 
| 17 | 18 | import matplotlib.transforms as mtransforms | 
| 18 |  | -from matplotlib.collections import EventCollection | 
|  | 19 | +from matplotlib.collections import Collection, EventCollection | 
| 19 | 20 | from matplotlib.testing.decorators import cleanup, image_comparison | 
| 20 | 21 | 
 | 
| 21 | 22 | 
 | 
| @@ -617,6 +618,25 @@ def test_size_in_xy(): | 
| 617 | 618 |     ax.set_ylim(0, 30) | 
| 618 | 619 | 
 | 
| 619 | 620 | 
 | 
|  | 621 | +def test_pandas_indexing(): | 
|  | 622 | +    try: | 
|  | 623 | +        import pandas as pd | 
|  | 624 | +    except ImportError: | 
|  | 625 | +        raise SkipTest("Pandas not installed") | 
|  | 626 | + | 
|  | 627 | +    # Should not fail break when faced with a | 
|  | 628 | +    # non-zero indexed series | 
|  | 629 | +    index = [11, 12, 13] | 
|  | 630 | +    ec = fc = pd.Series(['red', 'blue', 'green'], index=index) | 
|  | 631 | +    lw = pd.Series([1, 2, 3], index=index) | 
|  | 632 | +    aa = pd.Series([True, False, True], index=index) | 
|  | 633 | + | 
|  | 634 | +    Collection(edgecolors=ec) | 
|  | 635 | +    Collection(facecolors=fc) | 
|  | 636 | +    Collection(linewidths=lw) | 
|  | 637 | +    Collection(antialiaseds=aa) | 
|  | 638 | + | 
|  | 639 | + | 
| 620 | 640 | if __name__ == '__main__': | 
| 621 | 641 |     import nose | 
| 622 | 642 |     nose.runmodule(argv=['-s', '--with-doctest'], exit=False) | 
0 commit comments