(fig_test, fig_ref)
| 1422 | |
| 1423 | @check_figures_equal() |
| 1424 | def test_spy_box(fig_test, fig_ref): |
| 1425 | # setting up reference and test |
| 1426 | ax_test = fig_test.subplots(1, 3) |
| 1427 | ax_ref = fig_ref.subplots(1, 3) |
| 1428 | |
| 1429 | plot_data = ( |
| 1430 | [[1, 1], [1, 1]], |
| 1431 | [[0, 0], [0, 0]], |
| 1432 | [[0, 1], [1, 0]], |
| 1433 | ) |
| 1434 | plot_titles = ["ones", "zeros", "mixed"] |
| 1435 | |
| 1436 | for i, (z, title) in enumerate(zip(plot_data, plot_titles)): |
| 1437 | ax_test[i].set_title(title) |
| 1438 | ax_test[i].spy(z) |
| 1439 | ax_ref[i].set_title(title) |
| 1440 | ax_ref[i].imshow(z, interpolation='nearest', |
| 1441 | aspect='equal', origin='upper', cmap='Greys', |
| 1442 | vmin=0, vmax=1) |
| 1443 | ax_ref[i].set_xlim(-0.5, 1.5) |
| 1444 | ax_ref[i].set_ylim(1.5, -0.5) |
| 1445 | ax_ref[i].xaxis.tick_top() |
| 1446 | ax_ref[i].title.set_y(1.05) |
| 1447 | ax_ref[i].xaxis.set_ticks_position('both') |
| 1448 | ax_ref[i].xaxis.set_major_locator( |
| 1449 | mticker.MaxNLocator(nbins=9, steps=[1, 2, 5, 10], integer=True) |
| 1450 | ) |
| 1451 | ax_ref[i].yaxis.set_major_locator( |
| 1452 | mticker.MaxNLocator(nbins=9, steps=[1, 2, 5, 10], integer=True) |
| 1453 | ) |
| 1454 | |
| 1455 | |
| 1456 | @image_comparison(["nonuniform_and_pcolor.png"], style="mpl20") |
nothing calls this directly
no test coverage detected
searching dependent graphs…