()
| 614 | |
| 615 | |
| 616 | def test_quadmesh_cursor_data(): |
| 617 | x = np.arange(4) |
| 618 | X = x[:, None] * x[None, :] |
| 619 | |
| 620 | fig, ax = plt.subplots() |
| 621 | mesh = ax.pcolormesh(X) |
| 622 | # Empty array data |
| 623 | mesh._A = None |
| 624 | fig.draw_without_rendering() |
| 625 | xdata, ydata = 0.5, 0.5 |
| 626 | x, y = mesh.get_transform().transform((xdata, ydata)) |
| 627 | mouse_event = SimpleNamespace(xdata=xdata, ydata=ydata, x=x, y=y) |
| 628 | # Empty collection should return None |
| 629 | assert mesh.get_cursor_data(mouse_event) is None |
| 630 | |
| 631 | # Now test adding the array data, to make sure we do get a value |
| 632 | mesh.set_array(np.ones(X.shape)) |
| 633 | assert_array_equal(mesh.get_cursor_data(mouse_event), [1]) |
| 634 | |
| 635 | |
| 636 | def test_quadmesh_cursor_data_multiple_points(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…