()
| 1722 | |
| 1723 | |
| 1724 | def test_axesimage_get_shape(): |
| 1725 | # generate dummy image to test get_shape method |
| 1726 | ax = plt.gca() |
| 1727 | im = AxesImage(ax) |
| 1728 | with pytest.raises(RuntimeError, match="You must first set the image array"): |
| 1729 | im.get_shape() |
| 1730 | z = np.arange(12, dtype=float).reshape((4, 3)) |
| 1731 | im.set_data(z) |
| 1732 | assert im.get_shape() == (4, 3) |
| 1733 | assert im.get_size() == im.get_shape() |
| 1734 | |
| 1735 | |
| 1736 | def test_non_transdata_image_does_not_touch_aspect(): |