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

Function crop_to_same

lib/matplotlib/testing/compare.py:372–380  ·  view source on GitHub ↗
(actual_path, actual_image, expected_path, expected_image)

Source from the content-addressed store, hash-verified

370
371
372def crop_to_same(actual_path, actual_image, expected_path, expected_image):
373 # clip the images to the same size -- this is useful only when
374 # comparing eps to pdf
375 if actual_path[-7:-4] == 'eps' and expected_path[-7:-4] == 'pdf':
376 aw, ah, ad = actual_image.shape
377 ew, eh, ed = expected_image.shape
378 actual_image = actual_image[int(aw / 2 - ew / 2):int(
379 aw / 2 + ew / 2), int(ah / 2 - eh / 2):int(ah / 2 + eh / 2)]
380 return actual_image, expected_image
381
382
383def calculate_rms(expected_image, actual_image):

Callers 2

compare_imagesFunction · 0.85
save_diff_imageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…