| 1214 | |
| 1215 | @image_comparison(['imshow', 'imshow'], remove_text=True, style='mpl20') |
| 1216 | def 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', |