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

Function test_imshow

lib/matplotlib/tests/test_axes.py:1216–1233  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1214
1215@image_comparison(['imshow', 'imshow'], remove_text=True, style='mpl20')
1216def test_imshow():
1217 # use former defaults to match existing baseline image
1218 matplotlib.rcParams['image.interpolation'] = 'nearest'
1219 # Create an NxN image
1220 N = 100
1221 (x, y) = np.indices((N, N))
1222 x -= N//2
1223 y -= N//2
1224 r = np.sqrt(x**2+y**2-x*y)
1225
1226 # Create a contour plot at N/4 and extract both the clip path and transform
1227 fig, ax = plt.subplots()
1228 ax.imshow(r)
1229
1230 # Reuse testcase from above for a labeled data test
1231 data = {"r": r}
1232 fig, ax = plt.subplots()
1233 ax.imshow("r", data=data)
1234
1235
1236@image_comparison(['imshow_clip'], style='mpl20',

Callers

nothing calls this directly

Calls 3

sqrtMethod · 0.80
imshowMethod · 0.80
subplotsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…