()
| 1316 | style='_classic_test', |
| 1317 | tol=0 if platform.machine() == 'x86_64' else 0.012) |
| 1318 | def test_fill_between_interpolate(): |
| 1319 | x = np.arange(0.0, 2, 0.02) |
| 1320 | y1 = np.sin(2*np.pi*x) |
| 1321 | y2 = 1.2*np.sin(4*np.pi*x) |
| 1322 | |
| 1323 | fig, (ax1, ax2) = plt.subplots(2, 1, sharex=True) |
| 1324 | ax1.plot(x, y1, x, y2, color='black') |
| 1325 | ax1.fill_between(x, y1, y2, where=y2 >= y1, facecolor='white', hatch='/', |
| 1326 | interpolate=True) |
| 1327 | ax1.fill_between(x, y1, y2, where=y2 <= y1, facecolor='red', |
| 1328 | interpolate=True) |
| 1329 | |
| 1330 | # Test support for masked arrays. |
| 1331 | y2 = np.ma.masked_greater(y2, 1.0) |
| 1332 | # Test that plotting works for masked arrays with the first element masked |
| 1333 | y2[0] = np.ma.masked |
| 1334 | ax2.plot(x, y1, x, y2, color='black') |
| 1335 | ax2.fill_between(x, y1, y2, where=y2 >= y1, facecolor='green', |
| 1336 | interpolate=True) |
| 1337 | ax2.fill_between(x, y1, y2, where=y2 <= y1, facecolor='red', |
| 1338 | interpolate=True) |
| 1339 | |
| 1340 | |
| 1341 | @image_comparison(['fill_between_interpolate_decreasing.png'], |
nothing calls this directly
no test coverage detected
searching dependent graphs…