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

Function test_pngsuite

lib/matplotlib/tests/test_png.py:11–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10@image_comparison(['pngsuite.png'], style='default')
11def 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
29def test_truncated_file(tmp_path):

Callers

nothing calls this directly

Calls 6

PathClass · 0.85
figureMethod · 0.80
imshowMethod · 0.80
gcaMethod · 0.80
set_facecolorMethod · 0.45
set_xlimMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…