MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_fill_between_interpolate

Function test_fill_between_interpolate

lib/matplotlib/tests/test_axes.py:1318–1338  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1316 style='_classic_test',
1317 tol=0 if platform.machine() == 'x86_64' else 0.012)
1318def 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'],

Callers

nothing calls this directly

Calls 3

subplotsMethod · 0.45
plotMethod · 0.45
fill_betweenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…