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

Function compare_figure

lib/matplotlib/tests/test_backend_pgf.py:29–37  ·  view source on GitHub ↗
(fname, savefig_kwargs={}, tol=0)

Source from the content-addressed store, hash-verified

27
28
29def compare_figure(fname, savefig_kwargs={}, tol=0):
30 actual = os.path.join(result_dir, fname)
31 plt.savefig(actual, **savefig_kwargs)
32
33 expected = os.path.join(result_dir, "expected_%s" % fname)
34 shutil.copyfile(os.path.join(baseline_dir, fname), expected)
35 err = compare_images(expected, actual, tol=tol)
36 if err:
37 raise ImageComparisonFailure(err)
38
39
40@pytest.mark.parametrize("key, value, expected_str", [

Callers 2

test_rcupdateFunction · 0.85
test_bbox_inchesFunction · 0.85

Calls 4

compare_imagesFunction · 0.90
joinMethod · 0.80
savefigMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…