MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_axesimage_get_shape

Function test_axesimage_get_shape

lib/matplotlib/tests/test_image.py:1724–1733  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1722
1723
1724def 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
1736def test_non_transdata_image_does_not_touch_aspect():

Callers

nothing calls this directly

Calls 5

AxesImageClass · 0.90
gcaMethod · 0.80
get_shapeMethod · 0.80
set_dataMethod · 0.45
get_sizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…