()
| 2031 | |
| 2032 | @image_comparison(['affine_fill_to_edges.png'], style='_classic_test') |
| 2033 | def 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') |
nothing calls this directly
no test coverage detected
searching dependent graphs…