(fig_test, fig_ref)
| 200 | |
| 201 | @check_figures_equal() |
| 202 | def test_spy(fig_test, fig_ref): |
| 203 | np.random.seed(19680801) |
| 204 | a = np.ones(32 * 32) |
| 205 | a[:16 * 32] = 0 |
| 206 | np.random.shuffle(a) |
| 207 | a = a.reshape((32, 32)) |
| 208 | |
| 209 | axs_test = fig_test.subplots(2) |
| 210 | axs_test[0].spy(a) |
| 211 | axs_test[1].spy(a, marker=".", origin="lower") |
| 212 | |
| 213 | axs_ref = fig_ref.subplots(2) |
| 214 | axs_ref[0].imshow(a, cmap="gray_r", interpolation="nearest") |
| 215 | axs_ref[0].xaxis.tick_top() |
| 216 | axs_ref[1].plot(*np.nonzero(a)[::-1], ".", markersize=10) |
| 217 | axs_ref[1].set( |
| 218 | aspect=1, xlim=axs_ref[0].get_xlim(), ylim=axs_ref[0].get_ylim()[::-1]) |
| 219 | for ax in axs_ref: |
| 220 | ax.xaxis.set_ticks_position("both") |
| 221 | |
| 222 | |
| 223 | def test_spy_invalid_kwargs(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…