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

Function test_affine_fill_to_edges

lib/matplotlib/tests/test_image.py:2033–2057  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2031
2032@image_comparison(['affine_fill_to_edges.png'], style='_classic_test')
2033def test_affine_fill_to_edges():
2034 # The two rows show the two settings of origin
2035 # The three columns show the original and the two mirror flips
2036 fig, axs = plt.subplots(2, 3)
2037
2038 N = 7
2039 data = np.arange(N**2).reshape((N, N)) % 3
2040
2041 transform = [Affine2D(),
2042 Affine2D().translate(0, -N + 1).scale(1, -1),
2043 Affine2D().translate(-N + 1, 0).scale(-1, 1)]
2044
2045 for j in range(3):
2046 for i in range(2):
2047 origin = 'upper' if i == 0 else 'lower'
2048
2049 axs[i, j].imshow(data, cmap='Grays',
2050 interpolation='hanning', origin=origin,
2051 transform=transform[j] + axs[i, j].transData)
2052
2053 axs[i, j].set_axis_off()
2054 axs[i, j].vlines([-0.5, N - 0.5], -1, 2, lw=0.5, color='red')
2055 axs[i, j].vlines([-0.5, N - 0.5], N - 3, N, lw=0.5, color='red')
2056 axs[i, j].hlines([-0.5, N - 0.5], -1, 2, lw=0.5, color='red')
2057 axs[i, j].hlines([-0.5, N - 0.5], N - 3, N, lw=0.5, color='red')

Callers

nothing calls this directly

Calls 8

Affine2DClass · 0.90
translateMethod · 0.80
imshowMethod · 0.80
vlinesMethod · 0.80
hlinesMethod · 0.80
subplotsMethod · 0.45
scaleMethod · 0.45
set_axis_offMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…