|
27 | 27 | import matplotlib.markers as mmarkers |
28 | 28 | import matplotlib.patches as mpatches |
29 | 29 | from numpy.testing import assert_allclose, assert_array_equal |
30 | | -import warnings |
31 | 30 | from matplotlib.cbook import IgnoredKeywordWarning |
32 | 31 | import matplotlib.colors as mcolors |
33 | 32 |
|
|
36 | 35 | # different baseline images to prevent race conditions when nose runs |
37 | 36 | # the tests with multiple threads. |
38 | 37 |
|
| 38 | + |
39 | 39 | @image_comparison(baseline_images=['formatter_ticker_001', |
40 | 40 | 'formatter_ticker_002', |
41 | 41 | 'formatter_ticker_003', |
@@ -1151,6 +1151,27 @@ def test_hist_steplog(): |
1151 | 1151 | plt.hist(data_big, 100, histtype='stepfilled', log=True, orientation='horizontal') |
1152 | 1152 |
|
1153 | 1153 |
|
| 1154 | +@image_comparison(baseline_images=['hist_step_filled'], remove_text=True, |
| 1155 | + extensions=['png']) |
| 1156 | +def test_hist_step_filled(): |
| 1157 | + np.random.seed(0) |
| 1158 | + x = np.random.randn(1000, 3) |
| 1159 | + n_bins = 10 |
| 1160 | + |
| 1161 | + kwargs = [{'fill': True}, {'fill': False}, {'fill': None}, {}]*2 |
| 1162 | + types = ['step']*4+['stepfilled']*4 |
| 1163 | + fig, axes = plt.subplots(nrows=2, ncols=4) |
| 1164 | + axes = axes.flatten() |
| 1165 | + |
| 1166 | + for kg, _type, ax in zip(kwargs, types, axes): |
| 1167 | + ax.hist(x, n_bins, histtype=_type, stacked=True, **kg) |
| 1168 | + ax.set_title('%s/%s' % (kg, _type)) |
| 1169 | + ax.set_ylim(ymin=-50) |
| 1170 | + |
| 1171 | + patches = axes[0].patches |
| 1172 | + assert all([p.get_facecolor() == p.get_edgecolor() for p in patches]) |
| 1173 | + |
| 1174 | + |
1154 | 1175 | @image_comparison(baseline_images=['hist_step_log_bottom'], |
1155 | 1176 | remove_text=True, extensions=['png']) |
1156 | 1177 | def test_hist_step_log_bottom(): |
@@ -1765,7 +1786,7 @@ def test_boxplot(): |
1765 | 1786 | ax.set_ylim((-30, 30)) |
1766 | 1787 |
|
1767 | 1788 | # Reuse testcase from above for a labeled data test |
1768 | | - data={"x": [x, x]} |
| 1789 | + data = {"x": [x, x]} |
1769 | 1790 | fig, ax = plt.subplots() |
1770 | 1791 | ax.boxplot("x", bootstrap=10000, notch=1, data=data) |
1771 | 1792 | ax.set_ylim((-30, 30)) |
|
0 commit comments