| 9 | |
| 10 | @image_comparison(['pngsuite.png'], style='default') |
| 11 | def test_pngsuite(): |
| 12 | files = sorted( |
| 13 | (Path(__file__).parent / "baseline_images/pngsuite").glob("basn*.png")) |
| 14 | |
| 15 | plt.figure(figsize=(len(files), 2)) |
| 16 | |
| 17 | for i, fname in enumerate(files): |
| 18 | data = plt.imread(fname) |
| 19 | cmap = None # use default colormap |
| 20 | if data.ndim == 2: |
| 21 | # keep grayscale images gray |
| 22 | cmap = cm.gray |
| 23 | plt.imshow(data, extent=(i, i + 1, 0, 1), cmap=cmap, interpolation='nearest') |
| 24 | |
| 25 | plt.gca().patch.set_facecolor("#ddffff") |
| 26 | plt.gca().set_xlim(0, len(files)) |
| 27 | |
| 28 | |
| 29 | def test_truncated_file(tmp_path): |